users@glassfish.java.net

Re: Glassfish JavaMail Session and SMTP Authentication

From: <glassfish_at_javadesktop.org>
Date: Mon, 06 Oct 2008 16:47:47 PDT

The JavaMail support in glassfish is good for specifying a host and port, but you have to be able to use that host/port with no password (i.e. IP address based authentication). Basically sucks, but then again most UNIX hosts provide a local sendmail port to send on, so I guess it didn't seem like a big deal.

One issue you'll find with these remote MTA's is that the connection to them won't be too reliable, so having a localhost MTA that queues the email for delivery will give more reliable results in the long run anyway.

That said, I'm using an external MTA (authsmtp.com) and I just gave up on the JavaMail resources and wrote my own configuration management, storing the email configuration in the database. That made a lot of sense for my app, since I might have several email SMTP accounts configured depending on the user. If you just need one SMTP server for your whole application, you could store the extra properties as strings in JNDI, or system properties, whatever works ...
[Message sent by forum member 'dobes' (dobes)]

http://forums.java.net/jive/thread.jspa?messageID=303624