MailMessage mail = new MailMessage();
mail.From = "[email protected]";
mail.To = "[email protected]";
mail.Subject = this.TextBox1 .Text +this.DropDownList1 .SelectedItem .Text +"宾馆回答";
mail.Body = "祥情见附件";
mail.BodyFormat = MailFormat.Html;
mail.Attachments .Add (new MailAttachment(file));
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "yha77"); //set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "yha77"); //set your password here
SmtpMail.SmtpServer = "mail.ntachina.com";
SmtpMail.Send(mail);
请问:为什么报错:The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available
mail.From = "[email protected]";
mail.To = "[email protected]";
mail.Subject = this.TextBox1 .Text +this.DropDownList1 .SelectedItem .Text +"宾馆回答";
mail.Body = "祥情见附件";
mail.BodyFormat = MailFormat.Html;
mail.Attachments .Add (new MailAttachment(file));
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "yha77"); //set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "yha77"); //set your password here
SmtpMail.SmtpServer = "mail.ntachina.com";
SmtpMail.Send(mail);
请问:为什么报错:The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available
解决方案 »
- datalist中放了button不知道里面的事件怎么写?
- 网站发布的端口号怎么去掉的
- 还问个问题,在线等。。。。。
- doPostBack和this.value的问题
- 一个不知道该怎么问的问题。。。。。。。。。。
- 怎样实现"网页过期的问题",高手进,急
- DataList总是出错,帮我看一下.......很简单的.
- dropdownlist一直拿不到我要的值
- 救急!server.htmldecode的小问题
- Datalist??!!!
- 点击DataGrid的某行,在客户端用JavaScript改变这行的颜色表示选中,我用按钮提交(在提交之前我不想与服务器交互)到服务器端,我怎么知
- 求日期时间的证则表达式
{
jmail.Message jmailobj=new jmail.Message();
jmailobj.Logging=true;
jmailobj.Silent=true;
jmailobj.MailServerUserName=username; //发信邮件服务器的帐号
jmailobj.MailServerPassWord=pass; //密码
jmailobj.Body=content;
jmailobj.Charset="gb2312";
jmailobj.Subject=title;
jmailobj.From=from;
jmailobj.FromName="test";
jmailobj.AddRecipient(aim,"Name","A"); //收件人地址
jmailobj.Priority =1;
if(jmailobj.Send(smtp,false))
{
//Response.Write("ok");
return true;
}
else
{
return false;
}
}
#endregion
http://blog.joycode.com/ghj/archive/2004/10/22/36274.aspx
第一要配置SMTP服务,第一个网址里有
第二是关于杀毒软件的,因为有的杀毒软件会屏蔽掉25端口,第二个网址上有解释,
你可以把杀毒软件先关闭掉
看看是不是上面的两个原因