How to send email by jmail?

xiaoxiao2021-03-06  79

private void sendmail_jmail () {// use jmail mail transmission; need to add a reference jmail.dll //jmail.SMTPMailClass mail = new jmail.SMTPMailClass (); jmail.MessageClass msg = new jmail.MessageClass (); msg.From = This.Tb_from.Text.trim (); msg.addrecipient (this.tb_to.text.trim (), "Gallon Letter", ""); msg.body = this.tb_mailbody.text.trim (); msg.subject = "jamil to EST"; msg.mailserverusername = "Mailbox User Name"; msg.mailServerPassword = "Mailbox Password"; //msg.addattachment (FileName, False, "Test / HTML"); // Send attachment; msg. Send (this.tb_smtpserver.text.trim (), false; msg.close ();

}

Private void receivemail_jmail () {// jmail Receive mail; jmail.pop3class pm = new jmail.pop3class (); PM.Connect (this.mail_name.text.trim (), this.mail_password.text.trim (), this. Mail_Pop3Server.Text.trim (), 110); PM.Logging = true; pm.downloadMessages (); jmail.MessagesClass Msgs = (jmail.MessagesClass) PM.MESSAGES; for (int i = 1; i

----------------------------------- Finished -------------- -------------------

prompt:

Pay attention to interfaces, class conversions, otherwise messages, and accessories cannot be received;

The cycle starts at the time of reception (0); I don't know why; it will not be a ladybug;

Outside, if your Jmail.dll is in use;

You can use the .NET tool Tlbimp jmail.dll /out:newjmail.dll / namespace: Jmail packaged;

Over

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

New Post(0)