Practical application of components
Sub Sendmail (a_intid, a_stremail)
Const c_strmailserver = "smtp.163.net"
Dim objconn, objrs, strsql
Dim strcontent, strbody, strsubject, objemail
Strbody = "<HTML> Strbody = strbody + "<meta HTTP-EQUIV = Content-Type content = text/html; charset = gb2312>"
Strbody = strbody + "Strbody = strbody + "<a href = 'http: // www.china-168.net/center/default.asp>" + "Strbody = strbody + "<H3 style = 'font-size: 15px '>" + "Please confirm" + "Strbody = strbody + "<P style = 'font-size: 13px '>" + "Hello, <a href = mailto: "& a_stremail &"> "& a_stremail &" </a> "+" </TD> "+ vbcrlf
Strbody = strbody + "<P style = 'font-size: 13px '>" + "Welcome to subscribe to the hichina Information Network email list" + "</TD>"
Strbody = strbody + "<P style = 'font-size: 13px '>" + "to prevent subscription errors, click the following link for confirmation. Thank you! "+" </TD>"
Strbody = strbody + "<P style = 'font-size: 13px '>" + "<a href =" "http://www.china-168.net/EmailList/affirm.asp? Mode = maillist & content = "& a_stremail &" ">" + "Click here to confirm the subscription" + "</a>"
Strbody = strbody + "<P style = 'font-size: 13px '> <a href = http://www.china-168.net target =' _ blank '>" + vbcrlf
Strbody = strbody + "Strbody = strbody + "alt = 'more information available on Wanli info'> </a>
"
Strbody = strbody + "<P style = 'font-size: 13px '>" + "welcome to the Wanli Information Network again! "+" </TD>"
Strbody = strbody + "</body>
'Send 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 = "confirm subscription"
Objemail. ishtml = true
Objemail. charset = "gb2312"
Objemail. Body = strbody
Objemail. Send
'Inspection Error
If err. Number = 0 then', if yes
Response. Write ("<p align = center class = cn> to ensure that users are not harassed, we will send a confirmation letter. Please visit the URL in the letter to confirm registration </TD> ")
Else' if it fails, the error cause is displayed.
Response. Write ("<p align = center class = cn> email sending error. Error cause:
")
Response. Write ("<font color = Red>" & err. Description & "</font> </TD> ")
End if
'Cleaning
Set objemail = nothing
End sub
Use this process:
<%
.....
Rtsemail guestmailid, "" & Email &""
.....
%>