Now most of the mail to be validated, I write this article is to help you develop projects, and I hope you can give me some advice.
Refer the JMail to the project and join the JMail namespace, where I will refer to the MessageClass class of the JMail package.
Logging property: Log is used
Silent property: If set to True,jmail, no exception error is thrown. JMail. Send (() returns TRUE or false based on the action result
Mailserverusername property: The user name of the sender, such as:abcdef@163.com;
Mailserverpassword Property: Sender's password
From attribute: Sender
Subject Properties: Topics
AddAttachment () Method: Attaching Files
Body property: Message text.
The following is a complete example:
public bool SendMail ()
{
MessageClass email = new MessageClass ();
Email. Logging = true;
Email. Silent = true;
Email. Mailserverusername = "abcdef@163.com";
Email. Mailserverpassword = "124";
Email. from = "abcdef@163.com";
Email. Subject = "JMail";
Email. AddAttachment ("C:\\test.xml", True, "");
Email. BODY = "Test jmail send Mail";
Email. AddRecipient ("abcdef@163.com", "abc", NULL);
return email. Send ("mail.163.com", false)
}
Author: Pan Min
E-mail:jspanmin@jcc-net.com
Msn:jspanmin@163.com