当前位置: 代码迷 >> ASP.NET >> smtpmail发送email,该如何解决
  详细解决方案

smtpmail发送email,该如何解决

热度:5534   发布时间:2013-02-25 00:00:00.0
smtpmail发送email
MailMessage   Message   =   new   MailMessage();
Message.To   =   "wikimetro@gmail.com ";
Message.From   =   "\ "Wikimetro\ "   <info@ramdayo.com> ";
Message.Subject   =   "use   web   mail ";
Message.Body   =   "no   message "; Message.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate ",   "1 "); Message.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendusername ",   username); Message.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendpassword ",   password); Message.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/smtpserverport ",465); Message.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/smtpusessl ",   "true ");

SmtpMail.SmtpServer   =   "smtp.gmail.com ";   //.Insert(0, "209.85.199.111 ");
SmtpMail.Send(Message);
==============
在本地没问题,可一传到服务器上就不行了。
提示:Could   not   access   'CDO.Message '   object.错误信息
服务器用的是美国的
有解决的办法没有?
高手指点。。。

------解决方案--------------------------------------------------------
这个原因有很多种

这儿有详细的分析说明
http://blog.joycode.com/ghj/archive/2004/10/22/36274.aspx
------解决方案--------------------------------------------------------
看看这个资料。估计你会明白的
http://topic.csdn.net/t/20060424/09/4708199
------解决方案--------------------------------------------------------
1、没有权限:
具体看:
http://blog.joycode.com/ghj/archive/2004/02/17/13197.aspx

2、System.Web.Mail FAQ 这里提供了另外6种情况,我就不转贴了,自己查
http://www.systemwebmail.com/faq/4.2.3.aspx

3、你装了杀毒软件,或者防火墙,
以McAfee VirusScan Enterprise 8.0 为例,在端口限制中,默认限制了除 amgrsrvc.exe,tomcat.exe,outlook.exe,msimn.exe,agent.exe,eudora.exe,nlnotes.exe,mozilla.exe,netscp.exe,
opera.exe,pine.exe,poco.exe,thebat.exe,thunderbird.exe,ntaskldr.exe,inetinfo.exe,nsmtp.exe,nrouter.exe,
tomcat5.exe,tomcat5w.exe,ebs.exe,FireSvc.exe,modulewrapper.exe,MSKSrvr.exe,MSKDetct.exe 这些程序外对 25 端口的请求。 而25端口是SMTP 用的。这时候就会报 未能访问“CDO.Message”对象 对象错误;只要把你的程序名放到例外名单中,即可绕过这个限制。
4、你的Mail服务器性能不太好,经常超时,或其他错误,也会报:未能访问“CDO.Message”对象 的错误。



------解决方案--------------------------------------------------------
服务器注意:必须确保安装Smtp
  相关解决方案