C#发送带附件的邮件
MailMessage m = new MailMessage(); m.From = new MailAddress("ir@75271.com", "Raja Item"); m.To.Add(new MailAddress("su@75271.com", "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);