ASP JMail Email Detailed resolution 1th/2 page _ Application Tips

Source: Internet
Author: User

Send all the more detailed ASP and JMail implementation of the code to send mail, some time ago has sent a simple jmail mail message code, today the code to do a specific annotation, and added two other formats of code, with a few simple examples:

The first is Jmail.smtpmail's core code:

Copy Code code as follows:

<%
Set JMail = Server.CreateObject ("JMail. SmtpMail ")" Creates a JMail object
Jmail.silent = True ' JMail does not throw an exception error and returns a value of false and True
Jmail.logging = True ' Enable use of logs
JMail. Charset = "GB2312" The code for the message text is Simplified Chinese
JMail. ContentType = "text/html" The format of the message is HTML
JMail. ServerAddress = "server address" ' Sending a message
JMail. AddRecipient Email ' recipient of email '
JMail. SenderName = "SenderName" ' Mail sender's name
JMail. Sender = "Email address" ' e-mail addresses of senders
JMail. Priority = 1 ' Mail emergency program, 1 for fastest, 5 for slowest, 3 for default value
JMail. Subject = "Mail Subject" ' Title of Message
JMail. BODY = contents of mail body
JMail. ADDRECIPIENTBCC Email ' BCC Recipient's address
JMail. ADDRECIPIENTCC email ' cc's address
JMail. Execute () ' Send mail
JMail. Close ' Closes the mail object
%>

The W3 Jmail4.3 component has redesigned its internal structure--using the Message object instead of the original single object jmail.smtpmail sending mail, and some methods that require authentication (such as 163, Yahoo, etc.) can be resolved in the following ways:

Copy Code code as follows:

<%
Set JMail = Server.CreateObject ("JMail. Message ")" To create an object to send mail
Jmail.silent = True ' Mask exception error, return False to true two value J
Mail.logging = True ' Enable mail logging
JMail. Charset = "GB2312" ' Text encoding for the message is GB
JMail. ContentType = "text/html" The format of the message is HTML format
JMail. AddRecipient Email ' Address of Mail Recipient
JMail. from = "Email from to Sender" ' E-mail address of sender
JMail. Mailserverusername = "UserName of email" ' User name required to log on to the mail server
JMail. Mailserverpassword = "Password of email" ' Password required to log in to the mail server
JMail. Subject = "Mail Subject" ' Title of Message
JMail. BODY = contents of mail body
JMail. prority = 1 ' Mail emergency program, 1 for fastest, 5 for slowest, 3 for default value
JMail. Send ("server address") ' Perform mail delivery (via mail server addresses)
JMail. Close () ' Closes object
%>

current 1/2 page   1 2 Next read the full text
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.