I attach some files to the Email through the following method :
if (rad_upload.UploadedFiles != null && rad_upload.UploadedFiles.Count > 0)
{
foreach (UploadedFile file in rad_upload.UploadedFiles)
{
Attachment f = new Attachment(file.InputStream,
MediaTypeNames.Application.Octet);
attach.Add(f);
}
}
Contact_List.sendMail(mail, lbl_depEmailValue.Text.TrimEnd(),
password, txt_sub.Text, msg.ToString(), int.Parse(dep.Main_code.ToString()),
attach);
And in the sendMail method :
if (attachments != null && attachments.Count > 0)
{
foreach (Attachment a in attachments)
{
mail.Attachments.Add(a);
}
}
Every thing goes okay , but i wanna to know how to let the uploaded file opened with its convenient program automatically .
For example :
The pdf files opened automatically with acrobat reader if installed when double clicking on the file.
I think you have to set the
ContentTypeof yoursAttachmentsMSDN source