Asp发送邮件

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Dim email,topic,mailbody,sendto
yname=request("name")
yemail=request("email")
ycontent=request("message")
mailbody=mailbody+"名字:"+yname
mailbody=mailbody+"<br>邮箱:"+yemail
mailbody=mailbody+"<br>内容:"+ycontent
topic="[来自xxx.com的留言,]"+yname
sendto="目标信箱@163.com"
call Jmail(topic,mailbody,sendto)
sub Jmail(topic,mailbody,sendto)
on error resume next
dim JMail
Set JMail=Server.CreateObject("JMail.Message")
JMail.Logging = True
JMail.ContentType = "text/html"
JMail.Charset = "gb2312"
JMail.From = "你的信箱@163.com"
JMail.Subject = topic
JMail.Body = mailbody
JMail.AddRecipient sendto
JMail.Priority = 3
JMail.mailserverusername="你的信箱@163.com"
JMail.mailserverpassword="信箱密码"
JMail.Send("smtp.163.com")
'关闭并清除对象
JMail.Close()
Set JMail = Nothing
if err.number = 0 then
Response.Write(mailbody)
Response.Write("status=formOk")
end if
end sub
%>

你可能感兴趣的:(html,VBScript,asp)