mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-08 00:50:28 +08:00
feat: use SMTPAuthAutoDiscover in NewSmtpEmailProvider
This commit is contained in:
@ -31,8 +31,7 @@ type SmtpEmailProvider struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewSmtpEmailProvider(userName string, password string, host string, port int, typ string, disableSsl bool) (*SmtpEmailProvider, error) {
|
func NewSmtpEmailProvider(userName string, password string, host string, port int, typ string, disableSsl bool) (*SmtpEmailProvider, error) {
|
||||||
client, err := mail.NewClient(host, mail.WithSMTPAuth(mail.SMTPAuthPlain),
|
client, err := mail.NewClient(host, mail.WithSMTPAuth(mail.SMTPAuthAutoDiscover), mail.WithUsername(userName), mail.WithPassword(password), mail.WithPort(port))
|
||||||
mail.WithUsername(userName), mail.WithPassword(password), mail.WithPort(port))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user