Skip to content

Commit

Permalink
Use auto-discovery for SMTP authentication method.
Browse files Browse the repository at this point in the history
Replaced the hardcoded SMTPAuthPlain with SMTPAuthAutoDiscover to dynamically determine the best authentication method. This enhances compatibility with various email servers and reduces the need for manual configuration.
  • Loading branch information
wneessen committed Jan 9, 2025
1 parent af150b7 commit d3586e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/sendform.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func GetMailClient(f *form.Form) (*mail.Client, error) {
}
mc, err := mail.NewClient(f.Server.Host, mail.WithPort(f.Server.Port),
mail.WithUsername(f.Server.Username), mail.WithPassword(f.Server.Password),
mail.WithSMTPAuth(mail.SMTPAuthPlain), mail.WithTimeout(serverTimeout))
mail.WithSMTPAuth(mail.SMTPAuthAutoDiscover), mail.WithTimeout(serverTimeout))
if err != nil {
return mc, err
}
Expand Down

0 comments on commit d3586e9

Please sign in to comment.