Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Launch Default Mail client

Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to launch the default mail client when the user clicks a button on my gui. I need the email to come up with a subject and the body filled with data. I tried this by using the following command:

cmd /c start \"\" \"mailto:?subject=test&body=" + body + "\""

However this way I can not format my data (as the \n and \t does not work) and it does not allow anything larger than 1K. I saw that another option was possibly saving the message as an .eml file and then calling the eml file from the command line. I have no idea how to write the eml file. Can someone help me with what would be the best solution and if it is to save the message as an eml then how do you write and eml file?

Thanks for all of your help!
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic