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