using CK.SCP.Utils;
using MailKit.Security;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CK.SCP.Common
{
public class MailManager
{
///
/// 发送邮件
///
///
///
///
public static void SendMailOrders(string mails = "", string mailbody = "", string p_MailTitle = "")
{
try
{
List toList = new List();
EmailAddress add = new EmailAddress(mails, mails);
toList.Add(add);
var smtpMailSender = new MailKitMailSender(SecureSocketOptions.StartTls);
smtpMailSender.BuildOrderMessage(
toList,
p_MailTitle,
mailbody,
"BBC"
);
smtpMailSender.SendOrder();
}
catch (Exception e)
{
LogHelper.Writlog(LogHelper.LogType.Error, typeof(MailManager), "MailManager", e.Message + e.InnerException?.Message);
throw e;
}
}
}
}