title: Send e-mail from a Java desktop application
body: <p>I'm investigating what is the best way to go, in order to implement the functionality to send a plain text e-mail from a Java desktop application (cross platform, Linux, Win and Mac).</p>
  
  <p>Basically I'm exploring the javax.mail API and I'm considering the following three options;</p>
  
  <ol>
  <li><p>Through the javax.mail API using gmail SMTP server</p>
  
  <p><em>This option is the most easy to implement, however I think security wise it is not a   good option because the SMTP server password needs to be embedded into the code (Any jar file can be decompiled, hence the danger of exposing the password).</em></p></li>
  <li><p>Through the javax.mail API using a local SMTP server</p>
  
  <p><em>Security wise this would be ok. however it would require a client machine with a running SMTP server, I cannot assume all my users have a SMTP server running.</em></p></li>
  <li><p>Through the javax.mail API which uses an application instantiated SMTP server</p>
  
  <p><em>Portability wise and security wise this seems the best option. However this is also looks like a lot of work and is probably more easy said than done, hence I'm not sure if this is a feasible option.</em></p></li>
  </ol>
  
  <p>Obviously none of the three options are really satisfying and I wonder if I'm missing something obvious here, hence the reason for my question. Is there any reasonable way (regarding security, portability and amount of work needed) to implement this functionallity.</p>