Could you please tell me more about sending the mail via SMTP to the browser? Is it thereby possible to open the default mail client?
E-mail isn't sent to the browser - it is sent to the user's e-mail inbox; they can then use a mail client to retrieve the messages from their inbox. The only way I know to get the mail client to open from the browser is when you use a hyperlink to open a
new e-mail (using <a href="mailto:...">
, but that's a sending not receiving operation for the client.
Or is there any possibility to use JavaMail to send the mail directly from the server (instead of the client) to the receiver without getting into trouble with any security restrictions?
Absolutely - the point of JavaMail is to act as an interface for sending and receiving general e-mails. It wouldn't cause the mail client to open by default, but you could use an HTML message to alert the user that an e-mail has been sent to them, thereby prompting them to check for new mail. In order to send e-mails from JavaMail, all you need is an SMTP server (and the necessary permissions to use or relay from it) - you don't even have to be using
J2EE to do this (there are many Java mail clients out there using JavaMail to send/receive e-mail from client machines)!
Depending on how confident you are with Java as a whole, and how much of the technical details of e-mail you know about, I would either recommend looking at the API and deducing things from that, or alternatively finding a tutorial on the Web - trying searching Google for "JavaMail tutorial" or similar. You might also want to check/ask in the
Other Java APIs forum, since that covers JavaMail.
Good luck!