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 / C++ / MFC
  4. opening default mail client

opening default mail client

Scheduled Pinned Locked Moved C / C++ / MFC
helpjavasharepointquestion
1 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.
  • R Offline
    R Offline
    rohit dhamija 0
    wrote on last edited by
    #1

    Hi, I am invoking my mail client using following piece of code. The code opens the mail client having a subject and a file attached with it. Note: Following piece of code is written in java, i hope the same follows for vc also. String strLicensePath = "c:\\rohit.txt"; try { Runtime.getRuntime().exec( new String[] {"rundll32", "url.dll,FileProtocolHandler", "mailto:" + "&subject=" + "TEST_STRING" + "&attachment=" + "\""+ strLicensePath + "\""} ); } catch (Exception ex) { ex.printStackTrace(); } The above code works fine on my machine having "Microsoft Outlook 2000 SP-3" installed. But gives following error on machine having Microsoft Outlook 2002 installed: "The command line argument is not valid. Verify the switch you are using." Also, the problem is coming in some of other machines also. Am I using wrong switches, i.e. arguments?? Or is there any alternative way to achieve the same. Please comment.

    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