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