I omitted part of the code, the attachment is a picture
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
SmtpClient client = new SmtpClient();
string attachmentPath="c:\\test.jpg"
if(attachmentPath != "")
{
using (Attachment dataAttach = new Attachment(attachmentPath))
{
msg.Attachments.Add(new Attachment(attachmentPath));
dataAttach.Dispose();
}
}