Detailed analysis of ASP jmail mail page 1/2

Source: Internet
Author: User

Send detailed ASP and jmail to send emailsCodeA simple jmail email code was sent some time ago. Today, we will make a specific annotation for this code and add the code in two other formats, here are a few simple examples:

The core code of jmail. smtpmail is as follows:

Copy code The Code is as follows: <%
Set jmail = server. Createobject ("jmail. smtpmail") 'creates a jmail object
Jmail. Silent = true 'jmail does not throw exception errors. The returned values are false and true.
Jmail. Logging = true' enable use Log
Jmail. charset = "gb2312" 'the email text code is simplified Chinese
Jmail. contenttype = "text/html" 'the email format is html
Jmail. serveraddress = "server address" 'server for sending emails
Jmail. addrecipient email 'email recipient
Jmail. sendername = "sendername" 'name of the email sender
Jmail. Sender = "email address" 'email address of the sender
Jmail. Priority = 1' urgent email Program , 1 is the fastest, 5 is the slowest, and 3 is the default value
Jmail. Subject = "mail subject" 'mail title
Jmail. Body = "mail body" 'mail content
Jmail. addrecipientbcc email 'address of the BCC recipient
Jmail. addrecipientcc email 'email CC address
Jmail. Execute () 'execute the mail to send
Jmail. Close 'Close the email object
%>

W3 jmail4.3 component re-designs its internal structure -- uses the message object instead of the original single object jmail. smtpmail sends an email. Some methods require authentication (such as 163 and Yahoo). You can use the following methods to solve this problem:

Copy code The Code is as follows: <%
Set jmail = server. Createobject ("jmail. Message") 'creates the email sending object.
Jmail. Silent = true' to block exception errors. The values false and true are returned. j
Mail. Logging = true' enable Mail Log
Jmail. charset = "gb2312" 'the text of the email is encoded as the national standard
Jmail. contenttype = "text/html" 'the mail format is html
Jmail. addrecipient email 'email recipient's address
Jmail. From = "email from for Sender" 'sender's E-MAIL address
Jmail. mailserverusername = "username of email" 'username required to log on to the email server
Jmail. mailserverpassword = "password of email" 'Password required to log on to the email server
Jmail. Subject = "mail subject" 'mail title
Jmail. Body = "mail body" 'mail content
Jmail. prority = 1' urgent mail program, 1 is the fastest, 5 is the slowest, 3 is the default
Jmail. Send ("server address") 'executes the mail sending (via the mail server address)
Jmail. Close () 'Close the object
%>

Related Article

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.