go-simple-mail
go-simple-mail copied to clipboard
Use mail.Address instead of plain strings
With simple plain strings we are unable to set the name, only the address of the recipient(s). Use mail.Address.String() for headers, where full format works, and use mail.Address.Address for smtp's mail and rcpt methods to make it work with the smtp protocol.
If I can understand, do you want set the name of recipient?
yes:
Mr. Foo Bar <[email protected]>
Just keep in mind what I wrote above - you can use this format only in headers not in the smtp's methods which expect just plain email address.
I got it. I prefer use the plain string because I don't want to do a breaking change now. I will think how to maintain both ways instead dropping the current.
It's time to V3 so make all your ideas here: #53