<%
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" '郵(you)件正文格式
'JMail.ServerAddress = SMTPServer '用來發送郵件的SMTP服務器(無效)
'指定郵件服務器的地址。可以指定多個服務器,用分號點開。可以指定端口號。
'如果serverAddress保持空白,JMail會嘗試解決遠程郵件服務器,然后直接發送到服務器上去。???
'如:JMail.ServerAddress = &tquo;mail.mydom.net; mail2.mydom.net:2500"
JMail.MailServerUserName = SMTPServerUserName '登(deng)錄用(yong)戶名(ming)
JMail.MailServerPassWord = SMTPServerPassword '登錄密碼
JMail.MailDomain = MailDomain '域名(如果用“name@domain.com”這樣的用戶名登錄時,請指明domain.com
JMail.AddRecipient MailtoAddress,MailtoName '收信人
JMail.Subject = Subject '主題
JMail.Body = MailBody '郵件(jian)正文(wen)(純文(wen)本格式(shi))
JMail.FromName = FromName '發信人姓名
JMail.From = MailFrom '發(fa)信(xin)人Email
JMail.Priority = Priority '郵件等級12345
msg = JMail.Send(SMTPServer)
JMail.Close
set JMail = nothing
SendMail = msg
end function
%>
旗下網站:耐思智慧 - - - 中文域名:
耐思智慧(hui) © 版權所有 Copyright © 2000-2025 szjicheng.cn,Inc. All rights reserved
備案號碼:
公安備案號:
聲(sheng)明:本網(wang)站中所使用到的其他各種版權(quan)內(nei)容,包括但(dan)不限于(yu)文章、圖片(pian)、視頻、音頻、字體等內(nei)容版權(quan)歸原作(zuo)者所有,如權(quan)利所有人(ren)發現,請及(ji)時告知,以便我們刪除版權(quan)內(nei)容
本(ben)站(zhan)程序界面、源代碼受相關法律保護, 未(wei)經授權, 嚴禁使用(yong); 耐思智慧 © 為我公司注冊商(shang)標, 未(wei)經授權, 嚴禁使用(yong)
法律顧問: