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. Start Outlook Mail Message w/Attachments

Start Outlook Mail Message w/Attachments

Scheduled Pinned Locked Moved C#
helpquestion
2 Posts 1 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.
  • J Offline
    J Offline
    J 0
    wrote on last edited by
    #1

    I am trying to start an instance of an Outlook mail message with a few files attached, and am having some difficulty. I have about googled my fingers off to no avail... The code I have currently will work for only 1 attachment:

    System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("OUTLOOK.exe");
    psi.Arguments = "/a \"c:\\myfile.txt\"" ;
    System.Diagnostics.Process.Start(psi);

    I have tried specifying multiple /a command line switches to get multiple files attached such as /a "file 1" /a "file 2", and I have tried arguments /a "file 1" "file 2" as well. I have had no luck with either approach. Does anyone know of a way to specify multiple attachments through a command line argument? Thanks for your help.

    J 1 Reply Last reply
    0
    • J J 0

      I am trying to start an instance of an Outlook mail message with a few files attached, and am having some difficulty. I have about googled my fingers off to no avail... The code I have currently will work for only 1 attachment:

      System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("OUTLOOK.exe");
      psi.Arguments = "/a \"c:\\myfile.txt\"" ;
      System.Diagnostics.Process.Start(psi);

      I have tried specifying multiple /a command line switches to get multiple files attached such as /a "file 1" /a "file 2", and I have tried arguments /a "file 1" "file 2" as well. I have had no luck with either approach. Does anyone know of a way to specify multiple attachments through a command line argument? Thanks for your help.

      J Offline
      J Offline
      J 0
      wrote on last edited by
      #2

      After doing more research, it seems that the only way to accomplish this is through the user of Interop libraries. This link[^] may be of use to others who are trying to solve the same problem that I was.

      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