EmailName = "Name"
title="测试邮件标题"
user="test@sina.com"
content="测试邮件内容"'
files="logo.jpg"
dim jmail
set jmail=server.createobject("Jmail.message")
jmail.silent=true
jmail.charset="gb2312"
jmail.fromname= EmailName
jmail.from="webmaster@shsap.com"
jmail.addrecipient user
jmail.subject=title
jmail.mailserverusername="webmaster@shsap.com"
jmail.mailserverpassword="shsap200336"
jmail.maildomain="222.73.4.178"
jmail.body=content '邮件内容
contentId = JMail.AddAttachment (Server.Mappath(files), True) '附件
' 邮件主体(HTML(注意信件内链接附件的方式))
Response.Write(Err.Description)
sendok=jmail.send("222.73.4.178") 'smtp服务器名称
if sendok then
response.write "恭喜您,邮件发送成功"
else
response.write "对不起,邮件发送失败"
end if
阅读(845) | 评论(0) | 转发(0) |