<%
dim jmail
mailserver="mail.163.com" '邮局服务器地址(smtp服务器地址)
receive=request("email") '接受反馈信息的email地址(可以是您的任何有效信箱)
mailFROM="mail@163.com" '发邮件地址
username="mail@163.com" '发件人邮箱地址
password="888888" '发邮件密码
subject="主题"
body="邮件内容" '修改结束
'调用邮件发送
'群发就是 循环
'需要在web服务器上注册组件 w3JMail4Free.exe
call SendMail (subject, body, mailserver, receive, mailFROM, username,password)
Sub SendMail(subject, body, mailserver, receive, mailFROM, username,password)
Set jmail = Server.CreateObject("JMAIL.Message") '建立发送邮件的对象
jmail.silent = true '屏蔽例外错误,返回FALSE跟TRUE两值j
jmail.logging = true '启用邮件日志
jmail.Charset = "GB2312" '邮件的文字编码为国标
jmail.ContentType = "text/html" '邮件的格式为HTML格式
jmail.AddRecipient receive '邮件收件人的地址
jmail.From = mailFROM '发件人的E-MAIL地址
jmail.MailServerUserName = username '登录邮件服务器所需的用户名
jmail.MailServerPassword = password '登录邮件服务器所需的密码
jmail.Subject = subject '邮件的标题
jmail.Priority = 1 '邮件的紧急程序,1 为最快,5 为最慢, 3 为默认值
jmail.Body = body
flag=jmail.Send(mailserver) '执行邮件发送(通过邮件服务器地址)
if flag=true then
response.write"发送成功"
else
response.write"发送失败"
end if
jmail.Close '关闭邮件对象
set jmail=nothing
end sub
%>
使用前,必须安装Jmail4.5组件哦..