asp Jmail發(fā)送郵件的示例2把以下全部代碼內(nèi)容保存為jmail.asp文件,里面的郵箱信息修改為自己的即可 <%@ Language=VBScript %> <% '================================================== ' 參 數(shù) 設(shè) 置 '================================================== '修改收信人電子郵件地址,表單里的內(nèi)容將發(fā)送到這個信箱中 myemail ="test@test.com" '修改收信人姓名 myname ="我的公司" '修改SMTP服務(wù)器 smtpserver ="smtp.test.com" '修改SMTP服務(wù)器的用戶名和密碼 smtpuser ="test@test.com" smtppwd ="123456" '與相應(yīng)SMTP服務(wù)器對應(yīng)的郵件地址 '很多SMTP服務(wù)器除了要驗證用戶名和密碼外,還要驗證發(fā)件人地址, '比如163.net的SMTP服務(wù)器在檢查發(fā)信人郵件地址是不是以163.net '結(jié)尾,否則不予發(fā)送,因此,使用相應(yīng)的信箱做為發(fā)信人信箱是必要的 smtpemail ="test@test.com" '================================================== ' 程 序 開 始 '================================================== tname =Request("t1") temail =Request("t2") tother =Request("t3") tsubject =Request("t4") tbody =Request("t5") if tname <> "" and temail <> "" then set jmail=server.CreateObject ("jmail.message") jmail.Silent =true jmail.Charset ="gb2312" if smtpemail <> "" then jmail.From ="test@test.com" else jmail.From =temail end if jmail.FromName =tname jmail.ReplyTo =temail jmail.Subject ="網(wǎng)上提交:" & tsubject jmail.Body =tbody & vbcrlf & vbcrlf & "聯(lián)系方式:" & tother jmail.AddRecipient myemail,myname jmail.MailServerUserName =smtpuser jmail.MailServerPassWord =smtppwd isgo=jmail.Send(smtpserver) if isgo then msg="提交成功!謝謝您的支持。" else msg="發(fā)送失!請檢查您的郵件地址是否填寫正確。" end if jmail.Close set jmail=nothing end if %> <html>
|
|||||
| >> 相關(guān)文章 | |||||
|
|
|||||
400-028-5800
028-62778877
您好,非正常上班時間若有緊急技術(shù)問題,請撥總機后按7號鍵, 其他問題請?zhí)峤还位蛟谏习鄷r間聯(lián)系,謝謝支持!