go-gomail / gomail

The best way to send emails in Go.
MIT License
4.29k stars 569 forks source link

Unnecessary problem with "mail.ParseAddress(field)" #168

Open curiosport opened 2 years ago

curiosport commented 2 years ago

I am developing a website and during testing I need to use fake SMTP servers, what happens is that these servers give me the credentials in this format:

username = "29723d128c4d"
password = "642c04628110"

As you can see there is no traditional @, and when sending a mail, the function mail.ParseAddress(field) in the package gomail/send.go complains saying that there is no @, I made a fork and I have removed that function so I could use the fake SMTP, so my suggestion is to allow to disable this function, that there are two modes one for "production" and one for "development".

gomail: could not send email 1: gomail: invalid address "29723d128c4d": mail: missing '@' or angle-addr