<%
'使用时候直接CALL就可以了
function sendmail
'==================================================
' 参数设置开始,请修改相应参数
smtpserver = "smtp.163.com" '发送邮件所使用的SMTP服务器,例如smtp.163.com,请修改
smtpuser = "" '与SMTP服务器对应的邮箱用户名,请修改
smtppwd = "" '与SMTP服务器对应的邮箱密码,请修改
'如果SMTP服务器需要发信认证,则设置登录SMTP服务器的用户名和密码
'与相应SMTP服务器对应的邮件地址
'注意:很多SMTP服务器除了要验证用户名和密码外,还要验证发件人地
'址,比如163.com的SMTP服务器在检查发信人邮件地址是不是以163.com
'结尾,否则不予发送,因此,使用相应的信箱做为发信人信箱是必要的
'smtpemail = "" 'SMTP服务器发信邮箱,请修改
' 参数设置结束
'==================================================
aryEmail = split("123@123.com;345@345.com", ";")'可以填写多个邮箱,用分号隔开
username = request("name")
tel = request("tel")
kehumail = request("email")
feedtitle = request("title")
feedcontent =request("content")
senddata = now()
username = Request.form("Somane")
'这里用来调用提交表单的值,然后可以在mail的body中返回这些值
content = trim(Request("content"))
myemail=myemail &"""" '用来接收邮件的邮箱,请修改,可以与SMTP服务器发信邮箱不同
mailbody=mailbody &"<style>A:visited {TEXT-DECORATION: none}"
mailbody=mailbody &"A:active {TEXT-DECORATION: none}"
mailbody=mailbody &"A:hover {TEXT-DECORATION: underline}"
mailbody=mailbody &"A:link {text-decoration: none;}"
mailbody=mailbody &"BODY {FONT-FAMILY: arial; FONT-SIZE: 9pt;}"
mailbody=mailbody &"TD {FONT-FAMILY: arial; FONT-SIZE: 9pt}</style>"
mailbody=mailbody &"<TABLE border=0 width='800' align=center><TBODY><TR><TD>"
mailbody=mailbody &"<br/><br/>"
mailbody=mailbody &"<br/>"
mailbody=mailbody &"你收到以下这个反馈表单<br/><br/>"
mailbody=mailbody &"反馈时间为 "&senddata&"<br/>"
mailbody=mailbody &"反馈人为:"&username &"<br/>"
mailbody=mailbody &"<br/>"
mailbody=mailbody &"电话:"&tel&"<br/>"
mailbody=mailbody &"传真:"&fax&"<br/>"
mailbody=mailbody &"Email:"&kehumail&"<br/>"
mailbody=mailbody &"<div>"&content&"</div>"
mailbody=mailbody &"</TD></TR></TBODY></TABLE>"
set jmail= server.CreateObject ("jmail.message")
jmail.Silent = true
jmail.Charset = "gb2312"
JMail.ContentType = "text/html"
jmail.From = "" '发件人email,与SMTP服务器对应的邮箱用户名,请修改
jmail.FromName =""同上
jmail.ReplyTo =email
jmail.Subject ="客户反馈,详细"'邮件主题
for i=0 to UBound(aryEmail)
JMail.AddRecipient Trim(aryEmail(i))
next '给多人发送就是这里的FOR循环.
jmail.Body = mailbody
jmail.MailServerUserName = smtpuser
jmail.MailServerPassWord = smtppwd
isgo = jmail.Send(smtpserver)
jmail.Close
set jmail = nothing
if err.number<>0 then
response.write "send failed"
else
response.write "send succeed."
end if
end function
%>