Mail with Attachment
suggest changeMailMessage represents a mail message, which SmtpClient can send. Several file attachments can be added to the message. Disposing the message also disposes its attachments.
using System.Net.Mail;
using(MailMessage myMail = new MailMessage())
{
Attachment attachment = new Attachment(path);
myMail.Attachments.Add(attachment);
// further processing to send the mail message
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents