关于smtp的问题,真的可以解决哦!我就是这样成功的!
2004-12-02 20:52
597 查看
这两天做了一个小PROJECT,大致是一个SERVER监控系统,如果发现某部SERVER有异常,发送EMAIL到相关手机,以便在非工作时间和节假日也能及时知道系统故障。
其中一个功能就是发送EMAIL。程序是这样的:
myMailMsg.To = "888888888@mobile.att.net";
myMailMsg.From = "support@medicalit.net";
myMailMsg.Subject = "server down";
myMailMsg.Body = "Please call StarLan to chen Database Server";
myMailMsg.BodyFormat = MailFormat.Text;
SmtpMail.SmtpServer="localhost";
SmtpMail.Send(myMailMsg);
本来是用外部的SMTP SERVER
SmtpMail.SmtpServer="smtp.XXX.com";
但后来发现由于DATA CENTER的FIREWALL原因,改用
SmtpMail.SmtpServer="localhost";
运行后系统提示错误信息:
Email Fail
Could not access 'CDO.Message' object.
Here is the full error message output:
System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x8004020F): The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for 12321323@mobile.att.net
检查SMTP SERVICE,正常,估计是权限设置问题。打开IIS ADMIN,右键点击SMTP VIRTUAL SERVER,选择属性,在ACCESS中点RELAY,增加127.0.0.1。一路OK回去。
这时候再运行程序,邮件发送成功。
其中一个功能就是发送EMAIL。程序是这样的:
myMailMsg.To = "888888888@mobile.att.net";
myMailMsg.From = "support@medicalit.net";
myMailMsg.Subject = "server down";
myMailMsg.Body = "Please call StarLan to chen Database Server";
myMailMsg.BodyFormat = MailFormat.Text;
SmtpMail.SmtpServer="localhost";
SmtpMail.Send(myMailMsg);
本来是用外部的SMTP SERVER
SmtpMail.SmtpServer="smtp.XXX.com";
但后来发现由于DATA CENTER的FIREWALL原因,改用
SmtpMail.SmtpServer="localhost";
运行后系统提示错误信息:
Email Fail
Could not access 'CDO.Message' object.
Here is the full error message output:
System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x8004020F): The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for 12321323@mobile.att.net
检查SMTP SERVICE,正常,估计是权限设置问题。打开IIS ADMIN,右键点击SMTP VIRTUAL SERVER,选择属性,在ACCESS中点RELAY,增加127.0.0.1。一路OK回去。
这时候再运行程序,邮件发送成功。
相关文章推荐
- ISA Server 的故障排除工具(2)
- SQL Server 索引结构及其使用(一)--深入浅出理解索引结构第1/4页
- Slow shutdown of Windows 2003 Server after installing Exchange 2003 Server
- Slow shutdown of WindoServer after installing Exchange 2003 Server
- 千年零一虫
- ORACLE9i连接SYBASE的透明网关的配置
- Microsoft Visual Studio .NET 2003制作安装程序
- Java测试规范(引用)
- 在线等,一个十万火急的问题
- oracle中的分页
- SELECT TOP N 问题
- 完善的网上商店WebShop系统
- 关于数据库备份的问题!
- 備份服務器端SQL SERVER數據庫至本地目錄
- sql server7.0数据库恢复
- 越过调试这道槛——ASP.NET无法调试问题剖析
- 从注册表中还原MSNMessenger口令
- 非对称加密算法中求解大正整数模大正整数的余数的快速计算法
- 移植到 Windows 2000 和 COM+