Send an email in C # write code

xiaoxiao2021-03-06  65

The namespace of System.Web.mail in .NET Framework provides class SMTPMail, which is used to send emails. The following is the code I sending mail: MailMessage MM = New MailMessage (); mm.from = "lixun007@163.net "; Mm.to =" Bill@microsoft.com "; mm.subject =" Received back "; mm.body =" Why does the SMTP class server attribute does not provide password verification; mm.attachments.add (New MaiLattachment ("c: //test.txt"); // attachments implements the ILIST interface, you can add multiple attachments SMTPMAIL.SMTPSERVER = "Webmail.careland.com.cn"; // Set the SMTP server that sends mail, currently No login method for servers that require authentication //, such as 163.net, 163.com can't do, currently my company's SMTP server // Look at the big man's better way SMTPMAIL.SEND (mm); Messagebox.show ("ok"); // Test on Win2000

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

New Post(0)