♣
邮件
mailmessage mail = new mailmessage();
mail.from = "yha77@ntachina.com";
mail.to = "yha77@ntachina.com";
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
· 网友精彩回答:
jmail发送有件的函数
public boolean sendmail(string from,string smtp,string username,string pass,string aim,string title,string content)
{
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://www.cnblogs.com/jzywh/archive/2005/06/09/170783.html
http://blog.joycode.com/ghj/archive/2004/10/22/36274.aspx
第一要配置smtp服务,第一个网址里有
第二是关于杀毒软件的,因为有的杀毒软件会屏蔽掉25端口,第二个网址上有解释,
你可以把杀毒软件先关闭掉
看看是不是上面的两个原因
很明显嘛,邮件服务器不存在,最好的办法是 邮件服务器的 ip 地址
.- 更多问题:
- · a &= b 高手这是什么意思呀,请高手帮助
- · 组合框如可能显示二列呀?如何取第二列?
- · vb如何通过odbc访问远程sqlserver?(急!)
- · 做私活,给钱的时候别人找我要发票,我怎么办啊??
- · sun4216 come here!
- · 如何将Project中的项目计划图导入到Visio中的甘特图???
- · 群号(10710858)欢迎有(探讨人生)兴趣的朋友加入
- · 繁體VS2003,要的請進。。。。
- · DataGrid中的数据倒入Excel显示时,为什么出现下载界面,点击下载后又出现页面源代码下载
- · ASP连接MS-SQLSERVER
- · 打印控制
- · 找一个图片,谁能找到俺另开分100,50给找到的,50大家分。
- · 请问JS如何控制滚动条?
- · 一个关于log4j的小问题.....
- · treeview 和toolbar控件在哪里?
- · 简单函数语法问题。请教!
- · dos基础
- · delphi编程 | delphi
- · 组件相关技术
- · API编程
- · 木马防范 | 木马
- · 病毒抵御
- · 分布式学习
- · ic设计
- · ic网站
- · 意法半导体
- · database access
- · 语言lan
- · 保存位图
- · php ssl
- · ati nvidia
- · 分布式程序设计
- · 使用汇编写进注册表启动的简单例子
- · 禁用注册表有什么用处
- · 注册表在哪
- · 电脑注册表损坏时出现的十种症状
- · 怎样修改注册表
- · 如何恢复注册表啊
- · 谁有注册表恢复工具?
- · 80端口入侵

