jmail.Logging = true '记录日志
jmail.Charset = "gb2312" '邮件的文字编码为国标
jmail.ContentTransferEncoding = "base64" '邮件编码设为base64
jmail.Encoding = "gb2312"
jmail.ISOEncodeHeaders = false '邮件头不使用ISO-8859-1编码
jmail.AddHeader "Priority","3" '设置优先级,范围从1到5,越大的优先级越高,3为普通
jmail.AddHeader "MSMail-Priority","Normal" '添加邮件头,不要改动!
jmail.AddHeader "Mailer","Microsoft Outlook Express 6.00.2800.1437" '添加邮件头,不要改动!
jmail.AddHeader "MimeOLE","Produced By Microsoft MimeOLE V6.00.2800.1441" '添加邮件头,不要改动!
jmail.AddHeader "Originating-IP",request.ServerVariables("REMOTE_ADDR")
jmail.MailServerUserName = ServerEmail ' 身份验证的用户名(发送者)
jmail.MailServerPassword = ServerPswd ' 身份验证的密码(发送者)
jmail.From = ServerEmail ' 发送者地址
jmail.FromName = FromName ' 发送者姓名
jmail.Subject = Title ' 邮件主题
jmail.AddRecipientBCC(Email) '接收者地址
jmail.HTMLBody = Content '邮件内容
jmail.Send("smtp.163.com") '发送者的smtp服务器,到相应的邮箱网站上能查到
jmail.close()
Set jmail = Nothing
请参考以下说明:首先服务器上要安装发送邮件的组件,如JMAIL
然后编写代码
<%
Email = " test@163.com " ''收件人Email
Set jmail = Server.CreateObject("JMAIL.Message")'建立发送邮件的对象
jmail.silent = false '屏蔽例外错误,返回FALSE跟TRUE两值
jmail.logging = true '启用邮件日志
jmail.Charset = "GB2312" '邮件的文字编码为国标
jmail.ContentType = "text/html" '邮件的格式为HTML格式
jmail.AddRecipient Email '邮件收件人的地址
jmail.From = " test@163.com " '发件人的E-MAIL地址
jmail.MailServerUserName = " test@163.com " '登录邮件服务器所需的用户名
jmail.MailServerPassword = "test" '登录邮件服务器所需的密码
jmail.Subject = "Jmail邮件" '邮件的标题
jmail.Body = "Jmail邮件测试" '邮件的内容
jmail.Priority = 1'邮件的紧急程序,1 为最快,5 为最慢, 3 为默认值
jmail.Send("mail.163.com") '执行邮件发送(通过邮件服务器地址)。请修改成你的邮件服务器SMTP地址
jmail.Close() '关闭对象
%>
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)