Email service handles errors in try/catch more reliably.
Epub reader seems stable and working.
This commit is contained in:
parent
0206f376bc
commit
f27308190d
4 changed files with 30 additions and 12 deletions
|
|
@ -423,11 +423,7 @@ public class EmailService : IEmailService
|
|||
smtpClient.Timeout = 20000;
|
||||
var ssl = smtpConfig.EnableSsl ? SecureSocketOptions.Auto : SecureSocketOptions.None;
|
||||
|
||||
await smtpClient.ConnectAsync(smtpConfig.Host, smtpConfig.Port, ssl);
|
||||
if (!string.IsNullOrEmpty(smtpConfig.UserName) && !string.IsNullOrEmpty(smtpConfig.Password))
|
||||
{
|
||||
await smtpClient.AuthenticateAsync(smtpConfig.UserName, smtpConfig.Password);
|
||||
}
|
||||
|
||||
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault;
|
||||
|
||||
|
|
@ -445,6 +441,12 @@ public class EmailService : IEmailService
|
|||
|
||||
try
|
||||
{
|
||||
await smtpClient.ConnectAsync(smtpConfig.Host, smtpConfig.Port, ssl);
|
||||
if (!string.IsNullOrEmpty(smtpConfig.UserName) && !string.IsNullOrEmpty(smtpConfig.Password))
|
||||
{
|
||||
await smtpClient.AuthenticateAsync(smtpConfig.UserName, smtpConfig.Password);
|
||||
}
|
||||
|
||||
await smtpClient.SendAsync(email);
|
||||
if (user != null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue