返回顶部

收藏

C#发送带附件的邮件

更多
MailMessage m = new MailMessage();
m.From = new MailAddress("ir@outofmemory.cn", "Raja Item");
m.To.Add(new MailAddress("su@outofmemory.cn", "Sekaran Uma"));
m.Subject = "File attachment!";
m.Body = "See the attached file.";
m.Attachments.Add(new Attachment(@"C:\test.txt"));
// Send the message
SmtpClient client = new SmtpClient("smtp.w3mentor.com");
client.Send(m);

标签:发送邮件,附件,C#

收藏

0人收藏

支持

0

反对

0

发表评论