Practical Application of Asp-email components

Source: Internet
Author: User
Sub SendMail (A_intid, A_stremail)
Const C_STRMAILSERVER = "Smtp.163.net"
Dim objconn,objrs,strsql
Dim strcontent,strbody,strsubject,objemail


Strbody = "
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 + "

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 you subscribe to WANLI Information Network mailing list" + "</td>"

Strbody = strbody + "<p style= ' font-size:13px '" + "in order to prevent a subscription error, please click the link below to confirm. 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 subscribe to confirm "+" </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 to do in Wanli Information network ' > </a> <br>
Strbody = strbody + "<p style= ' font-size:13px '" "+" Welcome to visit 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 = "Subscription Confirmation"
Objemail.ishtml = True
Objemail.charset = "gb2312"
Objemail.body = Strbody
Objemail.send

' Procuratorial error
If Err.Number = 0 Then ' if successful
Response.Write ("<p align=center class=cn> to ensure the user is not harassed, we will issue a confirmation letter, please visit the URL in the letter to confirm registration </td>")
Else ' If the failure shows the cause of the error
Response.Write ("<p align=center class=cn> message send error, error reason: <br>")
Response.Write ("<font color=red>" &Err.Description& "</font> </td>")
End If

' Clear
Set objemail = Nothing
End Sub

Use this procedure:
<%
.....

Rtsemail guestmailid, "&email&"
.....

%>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.