disable really email send

This commit is contained in:
ngfrolov 2022-05-05 10:45:04 +05:00
parent 1c6dd22d33
commit 31634e653a

View File

@ -79,17 +79,16 @@ namespace AsbCloudInfrastructure.Services
foreach (var mailAddress in mailAddresses) foreach (var mailAddress in mailAddresses)
message.To.Add(mailAddress); message.To.Add(mailAddress);
message.Body = htmlBody; message.Body = htmlBody;
message.Subject = subject; message.Subject = subject;
message.IsBodyHtml = true; message.IsBodyHtml = true;
var client = new SmtpClient(smtpServer); using var client = new SmtpClient(smtpServer);
client.EnableSsl = true; client.EnableSsl = true;
client.UseDefaultCredentials = false; client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential(sender, smtpPassword); client.Credentials = new System.Net.NetworkCredential(sender, smtpPassword);
await client.SendMailAsync(message, token); //await client.SendMailAsync(message, token);
Trace.TraceInformation($"Send email to {string.Join(',', addresses)} subj:{subject} html body count {htmlBody.Count()}"); Trace.TraceInformation($"Send email to {string.Join(',', addresses)} subj:{subject} html body count {htmlBody.Count()}");
}; };
return func; return func;