Mail delivery under C # .NET (including accessories)

xiaoxiao2021-04-08  403

String aa = this.dbpath.replace ("//"). Replace ("//", "); mailmessage mailobj = new mailmessage (); // set mail send and receive address mailobj.From = Wthorse@gmail.com //mailobj.to =wthorse@gmail.com mailobj.cc=wthorse@gmail.com

Mailobj.Subject = "Title"; Mailobj.Body = "Text";

// HTML format mail mailobj.bodyFormat = mailformat.html;

// Set to advanced priority mailobj.priority = mailpriority.high;

/ / Add an attachment for email // Note: Here we have created a MaiLattachment object Add an attachment to Mailobj.attachments.Add (New MaiLattachment (aa));

// Send a mail smtpmail.smtpserver = mail server IP address using the SMTPMail object; SMTPMAIL.SEND (Mailobj); this.listbox1.items.add ("Database Send Success ... / R / N");

Also refer to the mail server configuration

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

New Post(0)