mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-03 17:17:36 +02:00
Parse the from string to extract the email address
This commit is contained in:
1 parent
edbe1de026
commit
c884ecfea1
2 files changed
+7
-2
No files matched your search
@@ -8,6 +8,7 @@ import (
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/smtp"
|
||||
"strings"
|
||||
|
||||
@@ -124,8 +125,12 @@ func sendMail(settings *setting.Mailer, recipients []string, msgContent []byte)
|
||||
}
|
||||
}
|
||||
|
||||
if err = client.Mail(settings.From); err != nil {
|
||||
if fromAddress, err := mail.ParseAddress(settings.From); err != nil {
|
||||
return err
|
||||
} else {
|
||||
if err = client.Mail(fromAddress.Address); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
for _, rec := range recipients {
|
||||
|
||||
Reference in new issue
Block a user