mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
Merge pull request #430 from xiecang/bugfix/send_smtp_mail
fix: ignore error "starttls command has been already sent"
This commit is contained in:
commit
b1a12a5759
@ -42,7 +42,12 @@ func (s *SMTPSendingService) Send(mail *models.Mail) error {
|
||||
|
||||
if ok, _ := c.Extension("STARTTLS"); ok {
|
||||
if err = c.StartTLS(nil); err != nil {
|
||||
return err
|
||||
errCode := err.(*smtp.SMTPError).Code
|
||||
if errCode == 503 {
|
||||
// TLS already active
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
if s.auth != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user