-
Notifications
You must be signed in to change notification settings - Fork 591
Open
Description
error: Recipient address rejected
if there is a list of receipts, and one of them is invalid, gomail will abort whole sending process, and it not make sense
func (c *smtpSender) Send(from string, to []string, msg io.WriterTo) error {
if err := c.Mail(from); err != nil {
if err == io.EOF {
// This is probably due to a timeout, so reconnect and try again.
sc, derr := c.d.Dial()
if derr == nil {
if s, ok := sc.(*smtpSender); ok {
*c = *s
return c.Send(from, to, msg)
}
}
}
return err
}
// !!!! it doesnt send any email if there is an invalid email address
for _, addr := range to {
if err := c.Rcpt(addr); err != nil {
return err
}
}
w, err := c.Data()
if err != nil {
return err
}
if _, err = msg.WriteTo(w); err != nil {
w.Close()
return err
}
return w.Close()
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels