Skip to content

Commit 570841b

Browse files
LennardF1989mikecp
authored andcommitted
Allow appsettings.json to set SMTP authentication to string.Empty
1 parent ba7db3b commit 570841b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Umbraco.Infrastructure/Mail/EmailSender.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ await client.ConnectAsync(_globalSettings.Smtp.Host,
131131
_globalSettings.Smtp.Port,
132132
(MailKit.Security.SecureSocketOptions)(int)_globalSettings.Smtp.SecureSocketOptions);
133133

134-
if (!(_globalSettings.Smtp.Username is null && _globalSettings.Smtp.Password is null))
134+
if (!string.IsNullOrWhiteSpace(_globalSettings.Smtp.Username) && !string.IsNullOrWhiteSpace(_globalSettings.Smtp.Password))
135135
{
136136
await client.AuthenticateAsync(_globalSettings.Smtp.Username, _globalSettings.Smtp.Password);
137137
}

0 commit comments

Comments
 (0)