日期:2014-05-17  浏览次数:20747 次

又是发送邮件失败?
代码如下:
topic= "您在训练网的修改密码资料 "

mailbody= " <html> "
mailbody=mailbody   &   " <title> 用户信息 </title> "
mailbody=mailbody   &   " <body> "
mailbody=mailbody   &   " <TABLE   border=0   width= '95% '   align=center> <TBODY> <TR> "
mailbody=mailbody   &   " <TD   valign=middle   align=top> "
mailbody=mailbody   &   request( "name ")& ",您好: <br> <br> "
mailbody=mailbody   &   "您在训练网注册的帐号信息发生改变,下面是你最新的帐号信息! <br> "
mailbody=mailbody   &   "下面是您在训练网的注册信息: <br> <br> "
mailbody=mailbody   &   "用户名: "&request( "name ")& " <br> "
mailbody=mailbody   &   "密     码: "&pwd& " <br> <br> "
mailbody=mailbody   &   "请妥善保管好自己的密码! <br> <br> "
mailbody=mailbody   &   "网站地址:http://www.qz185.cn <br> <br> <br> "
mailbody=mailbody   &   " <center> <font   color=red> 再次感谢您注册训练网 </a> </font> "
mailbody=mailbody   &   " </TD> </TR> </TBODY> </TABLE> <br> <hr   width=95%   size=1> "
mailbody=mailbody   &   " </body> "
mailbody=mailbody   &   " </html> "
rs.close

Set   JMail=Server.CreateObject( "JMail.Message ")
JMail.Charset= "gb2312 "
JMail.ContentType   =   "text/html "
jmail.from   =   "l25127@21cn.com "
jmail.silent   =   true
jmail.Logging   =   true
jmail.FromName   =   "训练网管理员 "
jmail.mailserverusername   =   "l25127 "
jmail.mailserverpassword   =   "123456 "
jmail.AddRecipient   email
jmail.body=mailbody
JMail.Subject=topic

if   not   jmail.Send   ( "smtp.21cn.com ")   then
SendMail= " "
else
SendMail= "OK "
end   if

if   SendMail= "OK "   then
sendmsg= " <p> ·   您的注册信息已经发往您的邮箱,请注意查收! </p> "
else
sendmsg= " <p> ·   系统出错,注册信息资料未能发送到您的邮箱! </p> "
end   if

                                  Response.write   sendmsg          


然后测试,打印出来的是 "系统出错,注册信息资料未能发送到您的邮箱! "为何呢?本地上有装JMAIL组件的.

------解决方案--------------------
国内的邮件服务器都是对这种发送方式做了限制的.
------解决方案--------------------
jmail.silent = false
看看错误信息