Exchange邮箱搭建
2024-09-06 21:22:29
出现的问题:
这个问题
需要设置可以通过指定邮件服务器进行relay的ip地址
smtp->properties->access->relay
add the ip address
public bool Send(string to, string from, string subject, string message)
{
try
{
MailMessage em = new MailMessage();
em.To = to;
em.From = from;
em.Subject = subject;
em.Body = message; //Found out how to send authenticated email via System.Web.Mail at http://SystemWebMail.com (fact 3.8)
if(this.UserName != null && this.Password != null)
{
em.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
em.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", this.UserName); //set your username here
em.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", this.Password); //set your password here
} SmtpMail.SmtpServer = this.SmtpServer;
SmtpMail.Send(em);
return true;
}
catch
{
return false;
}
} }
}
Exchange邮箱搭建:
最新文章
- 夺命雷公狗----Git---7---GitHub当仓库本地使用(完)
- photoshop cs5 key
- Log4Net配置以及使用
- 关于oracle ORA-28001的解决方法
- TNS-12541: TNS: 无监听程序 TNS-12560: TNS: 协议适配器错误 TNS-00511: 无监听程序
- thinkphp框架中session常识
- MySQL出现大量unauthenticated user的问题
- demo06
- 1037: [ZJOI2008]生日聚会Party - BZOJ
- 基于ArcGIS的栅格图像平滑处理(转)
- rhel5.8 ISO yum源配置
- 【转】Directx11 HelloWorld之HLSL的Effect框架的使用
- Struts2 拦截器—拦截action
- 理解java容器:iterator与collection,容器的起源
- .NET基础之this关键字
- 21.react 组件通信
- 树莓派motion监控安装配置相关事情
- aaronyang的百度地图API之LBS云与.NET开发 Javascript API 2.0【基本地图的操作】
- [转]如何禁止 IIS 在 C:\Windows\System32\LogFiles\HTTPERR 中生成日志文件
- Thunder团队--Alpha发布用户报告