Allow appsettings.json to set SMTP authentication to string.Empty
This commit is contained in:
committed by
Michael Latouche
parent
ba7db3b842
commit
570841b958
@@ -131,7 +131,7 @@ namespace Umbraco.Cms.Infrastructure.Mail
|
||||
_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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user