Asp-Email組件的實際應用

來源:互聯網
上載者:User
sub sendMail(a_intID , a_strEmail)
const c_strMailServer = "smtp.163.net"
dim objConn,objRs,strSql
dim strContent,strBody,strSubject,objEmail


strBody = "<html><head>"
strBody = strBody + "<meta HTTP-EQUIV=Content-Type content=text/html; charset=gb2312>"
strBody = strBody + "</head><body bgColor=#d2b48c>"
strBody = strBody + "<a href='http://www.china-168.net/center/default.asp>" + "<img src=banner.gif border=0>" + "</a>"
strBody = strBody + "<h3 style='FONT-SIZE: 15px'>" + "請您確認" + "</h>" + vbcrlf
strBody = strBody + "<p style='FONT-SIZE: 13px'>" + "您好<a href=mailto:"&a_strEmail&">"&a_strEmail&"</a>" + "</td>" + vbcrlf
strBody = strBody + "<p style='FONT-SIZE: 13px'>" + "歡迎您訂閱萬裡資訊網郵件清單" +"</td>"

strBody = strBody + "<p style='FONT-SIZE: 13px'>" + "為了防止出現訂閱錯誤,請您點擊以下連結進行確認。謝謝!" + "</td>"
strBody = strBody + "<p style='FONT-SIZE: 13px'>" + "<a href=""http://www.china-168.net/EmailList/affirm.asp?Mode=MailList&content="&a_strEmail&""">" + "請點擊這裡,進行訂閱確認" + "</a>"
strBody = strBody + "<p style='FONT-SIZE: 13px'><a href=http://www.china-168.net target='_blank'>" + vbcrlf
strBody = strBody + "<img src=logo.gif"
strBody = strBody + " alt='更多資訊盡在萬裡資訊網'></a><br>"
strBody = strBody + "<p style='FONT-SIZE: 13px'>" + "歡迎再次光臨萬裡資訊網!" + "</td>"
strBody = strBody + "</body></html>"


'發送email
on error resume next
set objEmail = server.CreateObject("Persits.MailSender")
objEmail.Host = c_strMailServer
objEmail.From = "jiabaoxu@163.net"
objEmail.FromName = "china-168.net"
objEmail.AddAddress a_strEmail
objEmail.Subject = "訂閱確認"
objEmail.IsHTML = true
objEmail.CharSet = "gb2312"
objEmail.Body = strBody
objEmail.Send

'檢察錯誤
if Err.number = 0 then '如果成功
Response.Write ("<p align=center class=cn>為確保使用者不被騷擾,我們將發出確認信,請訪問信中的URL以確認登記</td>")
else '如果失敗則顯示出錯原因
Response.Write ("<p align=center class=cn>郵件發送出錯,錯誤原因:<br>")
Response.Write ("<font color=red>"&Err.Description&"</font></td>")
end if

'清場
set objEmail = nothing
end sub

使用該過程:
<%
.....

RTSEmail GuestMailID,""&email&""
.....

%>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.