修改邮件端口测试

This commit is contained in:
2022-05-18 16:48:24 +08:00
parent 341b176f41
commit e540c32bce
6 changed files with 118 additions and 145 deletions
@@ -13,6 +13,7 @@ using IRaCIS.Application.Contracts;
using Microsoft.AspNetCore.Authorization;
using MailKit.Security;
using MimeKit;
using IRaCIS.Core.Application.Helper;
namespace IRaCIS.Core.Application.Contracts
{
@@ -601,24 +602,10 @@ namespace IRaCIS.Core.Application.Contracts
messageToSend.Body = builder.ToMessageBody();
using (var smtp = new MailKit.Net.Smtp.SmtpClient())
{
smtp.ServerCertificateValidationCallback = (s, c, h, e) => true;
await smtp.ConnectAsync("smtp.163.com", 465, SecureSocketOptions.StartTls);
await smtp.AuthenticateAsync("iracis_grr@163.com", "XLWVQKZAEKLDWOAH");
await smtp.SendAsync(messageToSend);
await smtp.DisconnectAsync(true);
}
await SendEmailHelper.SendEmailAsync(messageToSend, null);
await _trialSiteSurveyRepository.SaveChangesAsync();
return ResponseOutput.Ok();
@@ -857,19 +844,9 @@ namespace IRaCIS.Core.Application.Contracts
messageToSend.Body = builder.ToMessageBody();
using (var smtp = new MailKit.Net.Smtp.SmtpClient())
{
await SendEmailHelper.SendEmailAsync(messageToSend, null);
smtp.ServerCertificateValidationCallback = (s, c, h, e) => true;
await smtp.ConnectAsync("smtp.163.com", 465, SecureSocketOptions.StartTls);
await smtp.AuthenticateAsync("iracis_grr@163.com", "XLWVQKZAEKLDWOAH");
await smtp.SendAsync(messageToSend);
await smtp.DisconnectAsync(true);
}
var trialId = joinCommand.TrialId;