Send an email using the Jmail component (C #)

xiaoxiao2021-03-06  27

First, download the JMail component, you can install directly; you can also find Jmail.dll, manually register components. In the command line environment, to the directory where the Jmail.dll is located, running the regsvr32 jmail.dll, C # program, the lead is added to the using jmail, as follows: (Click the btnsend button to send mail)

Using jmail;

Private void btnsend_click (Object Sender, System.Eventargs E)

{

JMail.Message Jimentage = new jmail.MessageClass ();

JMessage.Charset = "GB2312";

JMessage.From = "fromuser

@ Benq.com ";

JMessage.FromName = "Eric LV";

JMessage.Replyto = "ReplayTo

@ Benq.com ";

JMessage.Subject = "Test Email from JMessage";

JMessage.AddRecipient ("Receiver

@ Benq.com "," Eric LV "," 123 ");

Jimentage.body = "jmail content";

JMESSAGE.MAILSERVERUSERNAME = "Eric LV";

Jimentage.mailServerpassword = "user password";

JMessage.send ("SMTP-Server", False);

MessageBox.show ("Email Sent SuccessFully!");

Jessage.close ();

}

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

New Post(0)