日期:2014-05-20  浏览次数:20484 次

smtp发邮件问题?
MailMessage   mail   =   new   MailMessage();
                mail.To   =   "hm8030@163.com ";
                mail.From   =   "bbb@163.com ";
                mail.Subject   =   "this   is   a   test   email. ";
                mail.Body   =   "Some   text   goes   here ";
                mail.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate ",   "1 ");
                mail.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendusername ",   "hm8030 ");
                mail.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendpassword ",   "8030960 ");
                SmtpMail.SmtpServer   =   "smtp.163.com ";

                try
                {
                        SmtpMail.Send(mail);  

                }
                catch   (Exception   ex)
                {
                        //this.WriteLogTxt( "ErrorMessage: "+ex.Message,false);
                        this.Label1.Text   =   ex.Message;
                      //   return   false;

                }

運行時提示說:

Could   not   create   an   object   of   type   'CDO.Message '.   Please   verify   that   the   current   platform   configuration   supports   SMTP   mail.  

我不知道到底那裡出錯了。在線等!!

------解决方案--------------------
帮你顶了。自己没碰过类似的错误!我发邮件都是用第三方的组件发的。
------解决方案--------------------
当初记得也出现过 去网上查了一下 发现这个组建问题多 就改用jmail了 很方便

lz可以去网上查一下 资料还是很多的
------解决方案--------------------
是啊!
如果要发的邮件不是很重要的话是可以考虑用第三方组件来实现
------解决方案--------------------
http://blog.csdn.net/tianzhenjing/archive/2006/12/22/1454413.aspx
------解决方案--------------------
你的操作系统没有装smtp服务

------解决方案--------------------
你的服务器可能没有配置好。
------解决方案--------------------
以前就因为这个问题一直得不到解决,所以就不使用 System.Web.Mail 了
http://www.cnblogs.com/yyw84/archive/2006/12/22/600686.html
------解决方案--------------------
iis 设置允许smtp转发

------解决方案--------------------