users@glassfish.java.net

Gassfish JavaMail Session and SMTP Authentication

From: <glassfish_at_javadesktop.org>
Date: Sat, 15 Mar 2008 14:48:07 PST

Hi,

I'm trying to set up email notifications with JNDI for Apache Roller, and I can't get it to work. The problem is that my SMTP server requires user name and password, and it is unclear to me how to specify them in a JavaMail Session in the Glassfish Admin Console. The documentation is a little bit vague ("Sun Java SystemApplication Server 9.1 Administration Guide", "Creating a JavaMail Session"):

"Additional Properties: Create properties required by applications, such as a
protocol-specific host or username property. The JavaMail API documentation lists the
available properties."

My question is, should it be possible to specify the username and password for SMTP authentication in the Glassfish JavaMail session? I tried the following:

mail.smtp.auth=true
mail.smtp.user=<my SMTP user>
mail.smtp.password=<my SMTP password>

But my SMTP server always replies "relaying not allowed". In a self-written application that runs in the same Glassfish instance and that uses the same JavaMail session, but explicitly sets the the SMTP user and password, emails can be sent successfully.

Thanks
Stephan
[Message sent by forum member 'smuehlst' (smuehlst)]

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