正在写邮件发送,为什么我收到邮件怎么这样啊
标题是:Delivery Status Notification (Failure)
内容是:
This is an automatically generated Delivery Status Notification.
Delivery to the following recipients failed.
(邮箱名)
信息碎片(0.29K)
邮件正文.eml(1.32K)
打开邮件正文,可以看到邮件的信息。
为什么出现这样的情况呢?
MailMessage mailMsg = new MailMessage();
mailMsg.BodyFormat = MailFormat.Html;
mailMsg.To = "wkidf@sina.com ";
mailMsg.From = "6325637@163.com ";
mailMsg.Subject = "标题 ";
mailMsg.Body = "内容 ";
mailMsg.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate ", "1 ");
mailMsg.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendusername ", "??? ");
mailMsg.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendpassword ", "??? ");
SmtpMail.SmtpServer.Insert( 0, "smtp.163.com ");
try
{
SmtpMail.Send(mailMsg);
this.Label1.Text= "成功 ";
return false;
}
catch (Exception err)
{
this.Label1.Text=err.ToString();
return true;
}
还有就是不知道,就是我写问号的地方,是写哪个邮箱的帐号和密码啊???
如果成功应该在多长时间能接受到邮件啊?
------解决方案--------------------发送人的帐号和密码
多长时间收到视SMTP服务器而定,一般像纯文本都是发了就有了~
垃圾邮件的原因有2个判断,一个是群发,一个是内容无实际内容或者有可被过滤到的内容
------解决方案--------------------using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;
public partial class Mail : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
MailMessage myMail = new MailMessage( "收件人址 ", "发件人地址 ");
myMail.Subject = TextBox2.Text;
myMail.Body = TextBox3.Text;
myMail.IsBodyHtml = true;
SmtpClient client = new SmtpClient();
client.Host = "220.181.12.16 ";//SMTP服务器
client.Port = 25;
//验证你的用户名和密码
client.Credentials = new System.Net.NetworkCredential( "用户名 ", "密码 ");
client.Send(myMail);
}
}
------解决方案--------------------发的不是很正规