1. 程式人生 > >C#發送帶附件的郵件的代碼

C#發送帶附件的郵件的代碼

body see () com chm tpc 附件 end bject

如下的代碼是關於C#發送帶附件的郵件的代碼。

MailMessage m = new MailMessage();
m.Subject = "File attachment!";
m.Body = "See the attached file.";
m.Attachments.Add(new Attachment(@"C:test.txt"));
SmtpClient client = new SmtpClient("smtp.w3mentor.com");
client.Send(m);




C#發送帶附件的郵件的代碼