Develop asp.net Mail send with C # and Jmail

zhaozj2021-02-16  47

Sending of Mail in ASP.NET

Now I have to send most of the need to verify, I have written this article to help you develop projects, I hope that everyone can give me an opinion.

Try JMail to the project, join Jmail's namespace, here I will reference the Jmail package for the MessageClass class.

Logging attribute: Whether to use a log

Silent property: If set to true, Jmail does not throw exception error. Jmail. Send (() returns true or false based on the results of the results

MailServerUserName Properties: The username of senders, such as: abcdef@163.com;

MailServerPassword Properties: Send a password

From property: sender

Subject Property: Theme

Addattachment () Method: Additional files

Body property: Mail body.

Here 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

转载请注明原文地址:https://www.9cbs.com/read-25055.html

New Post(0)