Skip to content

Commit

Permalink
Allow appsettings.json to set SMTP authentication to string.Empty
Browse files Browse the repository at this point in the history
  • Loading branch information
LennardF1989 authored and mikecp committed Nov 10, 2021
1 parent ba7db3b commit 570841b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Umbraco.Infrastructure/Mail/EmailSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ await client.ConnectAsync(_globalSettings.Smtp.Host,
_globalSettings.Smtp.Port,
(MailKit.Security.SecureSocketOptions)(int)_globalSettings.Smtp.SecureSocketOptions);

if (!(_globalSettings.Smtp.Username is null && _globalSettings.Smtp.Password is null))
if (!string.IsNullOrWhiteSpace(_globalSettings.Smtp.Username) && !string.IsNullOrWhiteSpace(_globalSettings.Smtp.Password))
{
await client.AuthenticateAsync(_globalSettings.Smtp.Username, _globalSettings.Smtp.Password);
}
Expand Down

0 comments on commit 570841b

Please sign in to comment.