Main jmail Parameters

Source: Internet
Author: User
Details:
JmailMain Parameter List

(1) Body (letter body): String
For example: Jmail. Body = "the content of the Form filled by the user can be taken from. "
(2) charset (character set, default: "US-ASCII"): String
For example: Jmail. Charset = "US-ASCII"
(3) contenttransferencoding: String
Specifies the encoding method for content transfer. The default value is "quoted-printable"
For example: Jmail. Contenttransferencoding = "base64"
(4) contenttype (contentype of a letter. The default value is "text/plain"): String
If you send an email in HTML format, change it to text/html.
For example: Jmail. Contenttype = "text/html"
(5) encoding: String
Set the attachment encoding method (default value: "base64 ). You can choose to use "base64", "uuencode" or "quoted-printable"
For example: Jmail. Encoding = "base64"
(6) log ( JmailThe created log, provided that the loging attribute is set to true, as shown below): String
For example, use response. Write ( Jmail. Log) statement to list log information.
(7) logging (whether to use logs): Boolean
For example: Jmail. Logging = true
(8) recipients: String
Read-only attribute. All recipients are returned.
For example: Response. Write ("" + Jmail. Recipients + "");
(9) replyto (specify another return address): String
For example: Jmail. Replyto = "anyother@mailhost.com"
(10) sender (sender's email address): String
For example: Jmail. Sender = "sender@mailhost.com"
(11) sendername (sender's name): String
For example: Jmail. Sendername = "1G"
(12) serveraddress (email server address): String
You can specify multiple servers and open them with a semicolon. You can specify the port number.
If serveraddress remains blank, JmailWill try the remote email server and then directly send it to the server.
For example: Jmail. Serveraddress = "mail.263.net.cn"
(13) Subject (set the mail title, which can be taken from .) : String
For example: Jmail. Subject = "customer feedback form"
(14) add file attachments to emails
For example: Jmail. Addattachment ("C:" anyfile.zip ")
(15) addcustomattachment (filename, data)
Add a custom attachment.
For example: Jmail. Addcustomattachment ("anyfile.txt", "Contents of file ");
(16) addheader (header, value)
Add a custom mail header.
For example: Jmail. Addheader ("originating-IP", "192.168.10.10 ");
(17) addrecipient (recipient): String
For example: Jmail. Addrecipient ("info@dimac.net ");
(18) addrecipientbcc (email), bcc recipient:
For example: Jmail. Addrecipientbcc ("anyone@mailhost.com ");
(19) addrecipientcc (email), CC recipient:
For example: Jmail. Addrecipientcc ("anyone@mailhost.com ")
(20) addurlattachment (URL, document name)
Download and add an attachment from the URL. The second parameter "document name" is used to specify the file name after the letter is received.
For example: Jmail. Addurlattachment ("http://www.chinabs.net/ Jmail. Zip "," Jmail")
(21) appendbodyfromfile (File Name:
For example: Jmail. Appendbodyfromfile ("C:" anyfile.txt ")
(22) appendtext (text)
Append the text of a letter, such as adding a greeting or other information.
For example: Jmail. Appendtext ("welcome to this site! ")
(23) Close (), Force JmailDisable the connection between the buffer and the email server:
For example: Jmail. Close ()
(24) execute (), execute mail sending
For example: Jmail. Execute ()

Uses comobj;

VaR
Jmail: Variant;
Begin
Try
Jmail: = Createoleobject ("Jmail. Message ");
Jmail. Silent: = true;
Jmail. Charset: = 'gb2312 ';
Jmail. Contenttype: = 'text/html ';
Jmail. From: = 'test @ 163.net ';
Jmail. Fromname: = 'www .test.com '; Response ';﹎
Jmail. Subject: = 'title ';
Jmail. Addrecipient ('email address ');
Jmail. Body: = 'information, available HTML ';
Jmail. Mailserverusername: = 'username ';
Jmail. Mailserverpassword: = 'Password ';
Try
Jmail. Send ('email Server ');
Showmessage ('sent successfully ');
Except
Showmessage ('sending failed ');
End;
Finally
Jmail. Close;
End;
End;

// Send a single message

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.