Skip to content

Commit eb8f640

Browse files
fix-issue-63
1 parent be5b403 commit eb8f640

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Web/Services/MessageServices.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ public void SendMail(MimeMessage message)
3434
client.Connect(_config.GetValue<string>("Email:SmtpHost"), _config.GetValue<int>("Email:SmtpPort"), _config.GetValue<bool>("Email:UseSSL"));
3535

3636
// Note: only needed if the SMTP server requires authentication
37-
client.Authenticate(_config.GetValue<string>("Email:SmtpUser"), _config.GetValue<string>("Email:SmtpPassword"));
37+
if(_config.GetValue<bool>("Email:UseAuthentication")){
38+
client.Authenticate(_config.GetValue<string>("Email:SmtpUser"), _config.GetValue<string>("Email:SmtpPassword"));
39+
}
3840

3941
client.Send(message);
4042
client.Disconnect(true);

Web/appsettings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"SmtpUser": "",
66
"SmtpPassword": "",
77
"SenderAddress": "",
8-
"UseSSL": false
8+
"UseSSL": false,
9+
"UseAuthentication": true
910
},
1011
"Logging": {
1112
"IncludeScopes": false,

0 commit comments

Comments
 (0)