mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-09 15:32:54 +01:00
I think it's fair that we reset the Msg.senderror
to nil
before we Client.Send
it.
Since the send error indicate an error during the mail delivery, in my opinion it should be reset when a re-send is initiated, so that the senderror field always represents the latest delivery error. The send error should be checked after mail delivery and before a retry is started.
This commit is contained in:
parent
47bff15de9
commit
88eb4c5663
2 changed files with 2 additions and 0 deletions
|
@ -18,6 +18,7 @@ func (c *Client) Send(ml ...*Msg) error {
|
|||
return fmt.Errorf("failed to send mail: %w", err)
|
||||
}
|
||||
for _, m := range ml {
|
||||
m.sendError = nil
|
||||
if m.encoding == NoEncoding {
|
||||
if ok, _ := c.sc.Extension("8BITMIME"); !ok {
|
||||
errs = append(errs, ErrServerNoUnencoded)
|
||||
|
|
|
@ -19,6 +19,7 @@ func (c *Client) Send(ml ...*Msg) (rerr error) {
|
|||
return
|
||||
}
|
||||
for _, m := range ml {
|
||||
m.sendError = nil
|
||||
if m.encoding == NoEncoding {
|
||||
if ok, _ := c.sc.Extension("8BITMIME"); !ok {
|
||||
rerr = errors.Join(rerr, ErrServerNoUnencoded)
|
||||
|
|
Loading…
Reference in a new issue