Opening the default email program.
-
How do I launch default e-mail client with a attachment already inserted? I want to use a open file dialog box to choose a pdf file, to use as an attachment, then open the default e-mail program with the attachment already inserted.
You can use the
ProcessStartInfo
andProcess
classes. The following code should get you started:private void bClick(object sender, EventArgs e)
{
ProcessStartInfo pi = new ProcessStartInfo("mailto:you@here.com");
Process.Start(pi);
}- Nick Parker
My Blog | My Articles -
You can use the
ProcessStartInfo
andProcess
classes. The following code should get you started:private void bClick(object sender, EventArgs e)
{
ProcessStartInfo pi = new ProcessStartInfo("mailto:you@here.com");
Process.Start(pi);
}- Nick Parker
My Blog | My ArticlesThanks for replying. I was able to open the default mail program with that code. I am still not able to insert a pdf as an attachment. I am using crystal reports to generate a report. I then export the report as a pdf file and open the default mail program. I am stuck on how to insert the pdf file that I exported as an attachment file. Thanks for your help.