Releases: xhit/go-simple-mail
RCPT expectCode correction
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.
Re-factored and bug fixes
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
ConnectTimeout and SendTimeout are type time.Duration instead int
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.
Removed unnecessary functions
Some functions were removed for avoid confusion like SendMail in smtp.go.
Also auth.go don't use CRAMMD5Auth
Better management creating clients
This update change you connect and send email. Useful for create multiples clients and send with persistent connection with a lot of connections
-NewSMTPServer() change to NewSMTPClient() and return new SMTPClient struct
-New() change to NewMSG()
-Public function Send() only receive SMTPClient struct
-Private function send() receive SMTPClient struct instead SendTimeout, Client and KeepAlive
-Double verification in send, first that SMTPClient struct is not nil and Client is not nil
-Public function Connect() return SMTPClient struct
-Private function checkKeepAlive() only receive SMTPClient struct
-Updated readme
Note: this update is for v2.1.0 and is not compatible with v2.0.0
Keep alive / persistent connection version
V2.0.0 make changes to support persistent connection aka Keep Alive
Also there are a new timeout called SendTimeout, is used to limit the time in seconds sending an email after client is connected.