mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-08 23:12:54 +01:00
Merge remote-tracking branch 'origin/feature/90_provide-a-way-of-knowing-which-emails-failedsucceeded-in-sending' into feature/90_provide-a-way-of-knowing-which-emails-failedsucceeded-in-sending
# Conflicts: # senderror.go
This commit is contained in:
commit
b8af7a6ffc
1 changed files with 2 additions and 9 deletions
11
senderror.go
11
senderror.go
|
@ -6,7 +6,7 @@ package mail
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"strconv"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -142,12 +142,5 @@ func (r SendErrReason) String() string {
|
|||
// isTempError checks the given SMTP error and returns true if the given error is of temporary nature
|
||||
// and should be retried
|
||||
func isTempError(e error) bool {
|
||||
ec, err := strconv.Atoi(e.Error()[:3])
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
if ec >= 400 && ec <= 500 {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
return e.Error()[0] == '4'
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue