代码如下
                           MailMessage mymsg=new MailMessage();
mymsg.From=this.tebsender.Text.Trim();
mymsg.To=this.tebreceiver.Text.Trim();
mymsg.Subject=this.tebsubject.Text.Trim();
mymsg.Priority=(MailPriority)this.ddlpriority.SelectedIndex;
         mymsg.BodyFormat=(MailFormat)this.ddlbodyformat.SelectedIndex;
mymsg.Body=this.tebbody.Text.Trim();
                           
try
{
SmtpMail.Send(mymsg);
this.lblerror.Text="发送成功!";
this.tebbody.Text="";
this.tebreceiver.Text="";
this.tebsender.Text="";
this.tebsubject.Text="";


}
catch(Exception ex)
{
this.lblerror.Text="发送失败:"+ex.ToString();
}
我输入的是:from:yanmin0223@eyou   to:[email protected]    Subject:测试邮件成功与否
            body:测试邮件成功与否,如果成功ok;如果失败no;
可是,我看到这个163的邮箱中没有我的邮件,在eyou里发现这个邮件,内容为:
                    This is an automatically generated Delivery Status Notification.
                    Delivery to the following recipients failed.
                    [email protected]
其中我的BadMail文件夹中没有失败的邮件,这是怎么回事?对了,我是用本机登录的,不是用域登录的,这样有关系吗?在线等。谢谢

解决方案 »

  1.   

    useremail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
    useremail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "wfcg");
    useremail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", System.Configuration.ConfigurationSettings.AppSettings["emailpwd"].ToString());
    SmtpMail.SmtpServer="smtp.sohu.com";不过sohu的不管用拉,
      

  2.   

    用Jmail组件吧!
    http://www.csdn.net/Develop/read_article.asp?id=33578
      

  3.   

    163的不行,换sina的试下。是邮件服务器给过滤掉了的缘故。
      

  4.   

    TO:lxxlily(菜刀打碎发)
    C请问CDO不是在装.NET时就装在里面的吗?如果不是,怎么装呀?