有个好奇怪的问题:
在asp中用JMail发邮件,同样的程序,用以前申请的163.com的邮箱发就可以发送成功,用最近新注册的163.com的邮箱发就不成功,请问有人可以解释这个问题吗?
程序如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<title>邮件发送</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
action=Request.Form("Submit")
if action<>"" then
sendername = "站长"
MailServerUserName="*******" '163.com的登入用户名
MailServerPassWord="*********" '163.com的登入密码
Send="smtp.163.com"
senderemail="*****@163.com" '163.com的邮箱地址
Set JMail = Server.CreateObject("JMail.Message")
'是否将信头编码成iso-8859-1字符集. 缺省是True
JMail.ISOEncodeHeaders = True
'如果JMail.silent设置为true,ErrorCode包含的是错误代码
JMail.Silent = True
JMail.Logging = true
'设置标题和内容编码,如果标题有中文,必须设定编码为gb2312
JMail.Charset = "gb2312"
'JMail.ContentType = "text/html" '如果发内嵌附件一定要注释掉这行,重要!
JMail.From = senderemail ' 发送者地址
JMail.FromName =sendername ' 发送者姓名
JMail.MailServerUserName = MailServerUserName ' 身份验证的用户名
JMail.MailServerPassword = MailServerPassWord ' 身份验证的密码
'加入新的收件人
JMail.AddRecipient Request.Form("ToMail")
JMail.Subject = Request.Form("subject")
JMail.Body = Request.Form("body")
JMail.Priority=1 '邮件等级,1为加急,3为普通,5为低级
if JMail.Send(Send) then '执行邮件发送(通过邮件服务器地址)smtp.域名.com 不一定是邮件服务器
response.Write "<script language=javascript>alert('邮件发送成功!');window.location.href='jmail.asp';</script>"
'response.Write("邮件发送成功")
else
response.Write "<script language=javascript>alert('服务器忙,邮件发送失败,请稍后在发!');window.location.href='jmail.asp';</script>"
end if
JMail.Close()
Set JMail = Nothing
end if
%>
參考答案:新注册的没有开POP3/SMTP服务