.........上个 帖子还有1段

q521863 q521863 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

public class SmtpMail
{
private static string _SmtpServer;

/// <summary>
/// 格式:SmtpAccount:Password@SmtpServerAddress<br>
/// 或者:SmtpServerAddress<br>
/// <code>
/// SmtpMail.SmtpServer="user:12345678@smtp.126.com";
/// //或者:
/// SmtpMail.SmtpServer="smtp.126.com";
/// 或者:
/// SmtpMail.SmtpServer=SmtpServerHelper.GetSmtpServer("user","12345678","smtp.126.com");
/// </code>
/// </summary>
public static string SmtpServer
{
set { _SmtpServer = value; }
get { return _SmtpServer; }
}

public static bool Send(MailMessage mailMessage, bool ESmtp, string username, string password)
{
SmtpServerHelper helper = new SmtpServerHelper();
return helper.ToSendEmail(_SmtpServer, 25, ESmtp, username, password, mailMessage);
}

}

#endregion
}
...全文
评论
收藏 已收藏
分享
返回顶部
q521863
.NET社区 62,272 成员 668,968 内容