<%
if Request("MailtoAddress") <> "" then
msg = SendMail
(Request("SMTPServer"),Request("SMTPServerUserName"),Request("SMTPServerPassword"),
Request("MailDomain"),Request("MailtoAddress"),Request("MailtoName"),Request("Subject"),
Request("MailBody"),Request("FromName"),Request("MailFrom"),Request("Priority"))
if msg then Response.Write("发送成功") else Response.Write("发送不成功")
Response.End()
end if
function
SendMail(SMTPServer,SMTPServerUserName,SMTPServerPassword,MailDomain,MailtoAddress,MailtoName,
Subject,MailBody,FromName,MailFrom,Priority)
dim JMail, msg
set JMail=Server.CreateObject("JMail.Message")
JMail.Charset="gb2312" '编码
JMail.silent=true '设置为true,JMail不会抛出例外错误.
JMail.ContentType = "text/plain" '邮件正文格式
'JMail.ServerAddress = SMTPServer '用来发送邮件的SMTP服务器(无效)
'指定邮件服务器的地址。可以指定多个服务器,用分号点开。可以指定端口号。
'如果serverAddress保持空白,JMail会尝试解决远程邮件服务器,然后直接发送到服务器上去。???
'如:JMail.ServerAddress = &tquo;mail.mydom.net; mail2.mydom.net:2500"
JMail.MailServerUserName = SMTPServerUserName '登录用户名
JMail.MailServerPassWord = SMTPServerPassword '登录密码
JMail.MailDomain = MailDomain '域名(如果用“name@domain.com”这样的用户名登录时,请指明domain.com
JMail.AddRecipient MailtoAddress,MailtoName '收信人
JMail.Subject = Subject '主题
JMail.Body = MailBody '邮件正文(纯文本格式)
JMail.FromName = FromName '发信人姓名
JMail.From = MailFrom '发信人Email
JMail.Priority = Priority '邮件等级12345
msg = JMail.Send(SMTPServer)
JMail.Close
set JMail = nothing
SendMail = msg
end function
%>
中华人民共和国增值电信业务经营许可证:粤B-20060337 最便宜互联(江苏)网络科技 www.zpynet.com 苏ICP备09075536号
最便宜互联 © 江苏 版权所有 Copyright © 2008-2023 www.zpynet.com inc . All rights reserved 苏公网安备 32021302000105号
网络IDC运营部:江苏三欧网络信息技术[AAA级信用] www.oooidc.com 核心合作伙伴:广州耐思尼克信息技术有限公司[AAA级信用]
版权所有 本站程序界面、源代码受相关法律保护,未经授权,严禁使用
法律顾问:珠海知名律师 夏天风 律师
【认准我们唯一官网:www.zpynet.com】