Most emails need to be verified. I will write this article.ArticleI hope it will help you with your development projects and give me some comments.
Reference jmail to the project and add the jmail namespace. Here I will reference the messageclass class of the jmail package.
Logging attribute: whether to use logs
Silent attribute: If set to true, jmail will not throw an exception. jmail. Send () will return true or false Based on the operation results
Mailserverusername property: the user name of the sender, such as: abcdef@163.com;
Mailserverpassword attribute: the sender's password
From attribute: sender
Subject attribute: topic
Addattachment () method: append a file
Body attribute: Body of the email.
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