<%If request("go")<>"sent" Then response.End
dim CLStr,msg,mailserver,username,password,receive
CLStr=Chr(13) & Chr(10)
mailserver="smtp.mail.yahoo.com"
username="houngchc@yahoo.com"
password="456963741ccc"
receive="ailalee18@gmail.com"
Set msg = Server.CreateObject("JMail.Message")
msg.Charset = "gb2312"
msg.logging = true '启用邮件日志
msg.silent=True'屏蔽例外错误,返回False或True
'msg.ContentType = "text/html"'邮件的格式为HTML格式
msg.Priority = 1 '邮件等级,1为加急,3为普通,5为低级
msg.MailServerUserName = username
msg.MailServerPassword = password
msg.From = username
msg.FromName = username
msg.AddRecipient (receive)
'msg.AddURLAttachment " http://192.168.159.1/Jmail/1.xls","毕业设计论文目录.xls",True
msg.Subject = "网站在线反馈:"&Request.Form("subject")
msg.HTMLBody = "网站在线反馈"&CLStr&CLStr
msg.HTMLBody = msg.HTMLBody&" 对方姓名:"&Request.Form("name")&CLStr msg.HTMLBody = msg.HTMLBody&" 对方信箱:"&Request.Form("email")&CLStr msg.HTMLBody = msg.HTMLBody&" 留言内容: " msg.HTMLBody = msg.HTMLBody&" "&Request.Form("content")&CLStr
msg.HTMLBody = msg.HTMLBody&" "
If msg.Send (mailserver) Then
Response.Write(" ")
else
Response.Write(" ")
End If
msg.close
set msg = nothing
%>
邮件发送成功,谢谢使用 |