Practical application of ASP-Email component

Source: Internet
Author: User

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 &""
.....

%>

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.