|
|
|
|
using crypto;
|
|
|
|
|
using Essensoft.Paylink.Alipay.Domain;
|
|
|
|
|
using LanguageExt.Pipes;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using static SKIT.FlurlHttpClient.Wechat.Api.Models.WxaBusinessPerformanceBootResponse.Types.Data.Types;
|
|
|
|
|
|
|
|
|
|
namespace Ds.Module.Mailkit
|
|
|
|
|
{
|
|
|
|
|
public class EmailOptions
|
|
|
|
|
{
|
|
|
|
|
public string FromAddress { get; set; }
|
|
|
|
|
public string ToAddress { get; set; }
|
|
|
|
|
public string Host { get; set; }
|
|
|
|
|
public string UserName { get; set; }
|
|
|
|
|
public string Password { get; set; }
|
|
|
|
|
//optionBuilder.UseMailKit(new MailKitOptions()
|
|
|
|
|
//{
|
|
|
|
|
// //get options from sercets.json
|
|
|
|
|
// Server = Configuration.GetValue<string>("EmailOptions:Host"),
|
|
|
|
|
// Port = Configuration.GetValue<int>("EmailOptions:Port"), 改非25端口
|
|
|
|
|
// SenderName = Configuration.GetValue<string>("EmailOptions:SenderName"),
|
|
|
|
|
// SenderEmail = Configuration.GetValue<string>("EmailOptions:FromAddress"),
|
|
|
|
|
|
|
|
|
|
// // can be optional with no authentication
|
|
|
|
|
// Account = Configuration.GetValue<string>("EmailOptions:UserName"),
|
|
|
|
|
// Password = Configuration.GetValue<string>("EmailOptions:Password"),
|
|
|
|
|
// // enable ssl or tls
|
|
|
|
|
// Security = true
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
// new Email()
|
|
|
|
|
// {
|
|
|
|
|
// SmtpServer = "smtp.masuit.com",// SMTP服务器
|
|
|
|
|
// SmtpPort = 25, // SMTP服务器端口
|
|
|
|
|
// EnableSsl = true,//使用SSL
|
|
|
|
|
// Username = "admin@masuit.com",// 邮箱用户名
|
|
|
|
|
// Password = "123456",// 邮箱密码
|
|
|
|
|
// Tos = "10000@qq.com,10001@qq.com", //收件人
|
|
|
|
|
// Subject = "测试邮件",//邮件标题
|
|
|
|
|
// Body = "你好啊",//邮件内容
|
|
|
|
|
//}.SendAsync(s =>
|
|
|
|
|
//{
|
|
|
|
|
// Console.WriteLine(s);// 发送成功后的回调
|
|
|
|
|
// });// 异步发送邮件
|
|
|
|
|
}
|
|
|
|
|
}
|