mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-22 13:50:49 +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 (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"strconv"
|
"fmt"
|
||||||
"strings"
|
"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
|
// isTempError checks the given SMTP error and returns true if the given error is of temporary nature
|
||||||
// and should be retried
|
// and should be retried
|
||||||
func isTempError(e error) bool {
|
func isTempError(e error) bool {
|
||||||
ec, err := strconv.Atoi(e.Error()[:3])
|
return e.Error()[0] == '4'
|
||||||
if err != nil {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if ec >= 400 && ec <= 500 {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue