Send an email with Jmail

xiaoxiao2021-03-06  84

First go to http://www.dimac.net/, its official download JMail4.4 version, click on Download on the home page, the official also provides a trial version of Jmail Server. But its Jmail is free, too Commercial version, the free version of the function is limited, such as the problem of the recipient function, is incompatible for some coding of the domestic post office.

First register with Regsvr32 Jmail.dll, add a reference JMail.dll in your project

Look below:

public string SendPassword () {jmail.Message MailObj = new jmail.MessageClass (); MailObj.From = "xxxx @ 163com"; // address of the sender MailObj.Logging = true; MailObj.MailServerUserName = "xxxx"; / / Sender user name mailobj.mailserverpassword = "xxxxxxx"; // server verification mailobj.htmlbody = "Hello, welcome to see this post, ^ _ ^:"; mailobj.charset = "gb2312"; mailobj.subject = "Hello "; Mailobj.fromname =" hey "; Mailobj.addRecipient (xxxx@xxxx.com," user "," a "); // Add recipient mailobj.Priority = 3; // Send

IF ("SMTP.163.com", false) {return "success";} else {return "fail";

OK, its sending function is so simple.

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

New Post(0)