This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Tomcat/Javamail Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat/Javamail Question" Watch "Tomcat/Javamail Question" New topic
Author

Tomcat/Javamail Question

Kim Kantola
Ranch Hand

Joined: May 17, 2001
Posts: 274
Hi All,
I have a question regarding sending javamail from my web app. I have the web app working on a server, and the mail host on a differant server. I am guessing that this is OK, but cannot seem to get it all to work. The web app doesn't have to be on the same server as the mail host does it?

The trouble I am having is I am getting an Authentication error. I have posted this problem in the "otherAPI" forum, but it is now appearing to be mostly a tomcat config issue,so hope it is OK to post it new here.

I have this in my context.xml file :


Here is my java code


The error message I see is :
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
javax.mail.AuthenticationFailedException
at javax.mail.Service.connect(Service.java:319)
at javax.mail.Service.connect(Service.java:169)
at javax.mail.Service.connect(Service.java:118)
at javax.mail.Transport.send0(Transport.java:188)
at javax.mail.Transport.send(Transport.java:118)


Does anyone see anything obvious that I am doing wrong?
Thanks very much.

[ March 18, 2008: Message edited by: Kim Kantola ]
[ March 18, 2008: Message edited by: Kim Kantola ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Duplicate of:
http://www.coderanch.com/t/274325/java/java/JavaMail-Tomat

Kim,
Please don't post the same question in multiple forums.
If you feel that it would do better in another forum, ask the moderators to move it there for you.

Thanks.
-Ben


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Kim Kantola
Ranch Hand

Joined: May 17, 2001
Posts: 274
Thanks Ben, I thought this would be OK (See my quote from below) when I had thought about this long enough to realize it was more of a tomcat problem than a java api problem.

I have posted this problem in the "otherAPI" forum, but it is now appearing to be mostly a tomcat config issue,so hope it is OK to post it new here.


What is most confusing to me is that I can use this method for a non - tomcat app, run on one server and connect and send email from another server on another network. however, I cannot get this to work from tomcat. Maybe the mail host has to be on the same server or at least on the same network?

Thanks,
Kim
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Kim, I've asked that your original question be moved to this forum since there is already quite a bit of discussion in that thread.

I've also asked that this one be closed.
Please continue in the original thread.

Thanks.
-Ben
 
jQuery in Action, 2nd edition
 
subject: Tomcat/Javamail Question
 
Similar Threads
Unknown SMTP host for gmail
JavaMail w/ Tomat problem
cannot send email through Outlook
JavaMail w/ Tomat problem
Mail Sending Issue...