Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Opening the default email program.

Opening the default email program.

Scheduled Pinned Locked Moved C#
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kornstyle
    wrote on last edited by
    #1

    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.

    N 1 Reply Last reply
    0
    • K kornstyle

      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.

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      You can use the ProcessStartInfo and Process 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

      K 1 Reply Last reply
      0
      • N Nick Parker

        You can use the ProcessStartInfo and Process 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

        K Offline
        K Offline
        kornstyle
        wrote on last edited by
        #3

        Thanks 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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups