代码如下
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文件夹中没有失败的邮件,这是怎么回事?对了,我是用本机登录的,不是用域登录的,这样有关系吗?在线等。谢谢
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文件夹中没有失败的邮件,这是怎么回事?对了,我是用本机登录的,不是用域登录的,这样有关系吗?在线等。谢谢
解决方案 »
- ASP.NET 绑定数据问题
- 传递参数(网址格式)Request.QueryString后发现被解码
- 如何访问三层架构的实体类
- 想买本关于HTML CSS 和JAVASCRIPT的书,大家给介绍本?
- GridView摸板列中的按钮修改当前行的数据
- 新年快乐!请大家帮忙解决一个树图难题...
- 誰能幫我看一下這段代碼錯在那裡了!!!
- 从Google新建了一个ASP.NET爱好者Group,有兴趣的朋友不妨加入一下哦。
- 怎样在ASP.NET中设置文件相对路径?
- 如何向包含字段名称是SQL关键字的access数据库INSERT记录?不能改字段名称
- ***讨论方案:如何对更新的内容作历史纪录?***
- 有没有对ListBox比较好的方法!!!
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的不管用拉,
http://www.csdn.net/Develop/read_article.asp?id=33578
C请问CDO不是在装.NET时就装在里面的吗?如果不是,怎么装呀?