My requirement is attach PDF file to email and open with default mail client(like outlook or windows live mail) using C# code.
This should be done with default e-mail client that the user has configured as their default.
I checked MAPI to this. However still i couldn’t found proper code to do this
This is the code i used
MailMessage message = new MailMessage();
Attachment data = new Attachment(file, MediaTypeNames.Application.Octet);
ContentDisposition disposition = data.ContentDisposition;
disposition.CreationDate = System.IO.File.GetCreationTime(file);
disposition.ModificationDate = System.IO.File.GetLastWriteTime(file);
disposition.ReadDate = System.IO.File.GetLastWriteTime(file);
message.Attachments.Add(data);
Try below code :