如下的代码是关于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);
原文地址:https://www.cnblogs.com/lpypg/p/10689429.html
时间: 2024-10-05 07:24:03