重开一贴,发送邮件失败?
代码如下:
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组件的.
请大家帮帮忙看看!谢谢!
------解决方案--------------------晕哦........你把目标邮箱地址写到哪里了呢?
------解决方案--------------------Set jmail = Server.CreateObject( "JMAIL.Message ") '建立发送邮件的对象
if Err.Number <> 0 then
response.Write( " <br> 当前服务器不支持Jmail组件,所以不能发信息了 ")
err.clear
else
jmail.silent = true '屏蔽例外错误,返回FALSE跟TRUE两值j
jmail.logging = true '启用邮件日志
jmail.Charset = "GB2312 " '邮件的文字编码为国标
jmail.ContentType = "text/html " '邮件的格式为HTML格式
jmail.AddRecipient sendto '邮件收件人的地址
jmail.From = from '发件人的E-MAIL地