明輝手游網(wǎng)中心:是一個(gè)免費(fèi)提供流行視頻軟件教程、在線學(xué)習(xí)分享的學(xué)習(xí)平臺(tái)!

aspemail組件的應(yīng)用

[摘要]sub sendMail(a_intID , a_strEmail) const c_strMailServer = "smtp.163.net" dim o...
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=http://www.china-168.net/center/images/banner.gif border=0>" + "</a>"
      strBody = strBody + "<h3 style='FONT-SIZE: 15px'>" + "請(qǐng)您確認(rèn)" + "</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'>" + "歡迎您訂閱萬(wàn)里信息網(wǎng)郵件列表" +"</td>"
      strBody = strBody + "<p style='FONT-SIZE: 13px'>" + "為了防止出現(xiàn)訂閱錯(cuò)誤,請(qǐng)您點(diǎn)擊以下鏈接進(jìn)行確認(rèn)。謝謝!" + "</td>"
      strBody = strBody + "<p style='FONT-SIZE: 13px'>" + "<a href=""http://www.china-168.net/EmailList/affirm.asp?Mode=MailList&content="&a_strEmail&""">" + "請(qǐng)點(diǎn)擊這里,進(jìn)行訂閱確認(rèn)" + "</a>"
      strBody = strBody + "<p style='FONT-SIZE: 13px'><a href=http://www.china-168.net target='_blank'>" + vbcrlf
      strBody = strBody + "<img src=http://www.china-168.net/images/logo.gif"
      strBody = strBody + " alt='更多信息盡在萬(wàn)里信息網(wǎng)'></a><br>"
      strBody = strBody + "<p style='FONT-SIZE: 13px'>" + "歡迎再次光臨萬(wàn)里信息網(wǎng)!" + "</td>"
      strBody = strBody + "</body></html>"
      
      '發(fā)送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 = "訂閱確認(rèn)"
      objEmail.IsHTML = true
      objEmail.CharSet = "gb2312"
      objEmail.Body = strBody
      objEmail.Send
      
      '檢察錯(cuò)誤
      if Err.number = 0 then   '如果成功
         Response.Write ("<p align=center class=cn>為確保用戶不被騷擾,我們將發(fā)出確認(rèn)信,請(qǐng)?jiān)L問(wèn)信中的URL以確認(rèn)登記</td>")
      else                    '如果失敗則顯示出錯(cuò)原因
         Response.Write ("<p align=center class=cn>郵件發(fā)送出錯(cuò),錯(cuò)誤原因:<br>")
         Response.Write ("<font color=red>"&Err.Description&"</font></td>")
      end if   
      
      '清場(chǎng)
      set objEmail = nothing
  end sub

使用該過(guò)程:
<%
.....

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

%>