Common class attributes and methods of jmail Components

Source: Internet
Author: User

These objects of the jmail component provide various functions for the server to perform mail operations. Each object has its unique application, which is roughly as follows:
1. a POP3 object is an operation on the POP3 mail receiving server.
2. The messages object is the object related to the mail set.
3. The message object is the object related to the mail. It is the most common object of the jmail component and can send or receive mail information.
4. the header object is an object related to the mail header.
5. The recipients object is the object related to the receiving mail set.
6. The recipient object is the object for receiving emails.
7. The attachments object is the object related to the Mail Attachment set.
8. The attachment object is the object related to the email attachment.
9. mailmerge object, which is an object related to the mail template.
10. The pgpkeys object is the object related to the PGP key set of the mail.
11. The pgpkeyinfo object is the object related to the PGP key information of the email.
In the web application sent by mail, message objects are the most commonly used. before using them, you need to create this object and assign values to variables.


The message object has the following common attributes and methods:
1. Silent attribute, which indicates to block exception errors and return false or true values. If the value is true, it indicates that the mail will ignore the error and will not return the error information to the operating system.
Jmail. Silent = true
2. the logging attribute indicates whether to enable logs.
Jmail. Logging = true
3. charset attribute: Set the character set displayed in the mail. You can use gb2312 for simplified Chinese characters.
Jmail. charset = "gb2312"
4. The contenttype attribute indicates the mail body type.
Jmail. contenttype = "text/html"
5. The addrecipient method indicates the email address of the recipient.
Jmail. addrecipient (" ")
6. The from attribute indicates the sender's email address. This address is generally the same as the Logon account required for SMTP server authentication.
Jmail. From = ""
7. The fromname attribute indicates the sender's name.
Jmail. fromname = ""
8. The subject attribute indicates the title of the sent mail.
Jmail. Subject = "this is the mail title"
9. The body attribute indicates the body content of the sent email. You can use the HTML Tag. Code
Jmail. Body = "this is the mail content <br> display of line breaks"
10, priority attribute, indicating the priority of mail sending. 1 is the fastest, 5 is the slowest, and 3 is the default value.
Jmail. Priority = 1
11. mailserverusername attribute indicates the Logon account set when the mail server uses SMTP sending verification.
Jmail. mailserverusername = ""
12. mailserverpassword attribute, indicating the logon password set when the mail server uses SMTP sending verification.
Jmail. mailserverpassword = "**************"
13. The send method indicates sending an email through the specified email sending server. Note that the mail server address is consistent with the value in mailserverusername and mailserverpassword.
Jmail. Send (" ")
14. The close method indicates the cache space used to release the connection between jmail and the mail server.
Jmail. Close ()


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: 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.