👌 Support SMTPUTF8 extension to send email to addresses that contains UTF-8 characters
In this version is possible to specify PLAIN , LOGIN and CRAM-MD5 authentication
For this, in SMTPServer struct obtained by NewSMTPClient() function, the Authentication variable should be a authType: AuthPlain, AuthLogin, AuthCRAMMD5
If was not specified, default is AuthPlain.
Also, added compatibility to Go Modules.
iota corrections and SendTimeout improved
- new private function sendMailProcess for send the mail. Function is called in private function send
- improved SendTimeout , if 0 then send call directly to sendMailProcess , else, sendMailProcess is called in goroutine and return the result in channel smtpSendChannel if timeout never happens
- change direction of iota for encryption , encoding , and contentType (this don't break anything)
smtp.go: expectCode correction for RCPT for match 25x return code.
Earlier versions match only 250.
Match 25x return like valid code the 251 (User not local; will forward to )
🗄 251 code is deprecated in SMTP, but who knows who still uses it.
This version break your code!
SetBody and AddAlternative receive contentType var type instead string. Earlier the string were text/html and text/plain, now you need call mail.TextHTML or mail.TextPlain
♻️ Code refactored for make all smtp and auth functions private. If you use it or you need a function in these files, pull a request for add it to email.go if need it.
➕ Added header.go and test, now you don't need download other dependencies.
⚡️ Comments updated in al files
⚡️ Updated readme and test
Timeout type time.Duration instead int. Be sure you cast it!
- ConnectTimeout and SendTimeout are type time.Duration instead int
- 🆕 NewSMTPClient() return by default 10 seconds for ConnectTimeout and SendTimeout and default Encryption is EncryptionNone
- ⚡️ Updated readme and example_test
PD: v2.1.2 not exists. A simple mistake.