• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaMail works on one server, but not another

 
Jennifer Bhamoo
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I don't even know where to begin to try and troubleshoot this.

I am using JavaMail 1.4 to send an email and it works on my laptop, but when I deploy to my server, no email gets sent. (Edit: both machines are on the same network.)

I am using JBoss 3.2.5 and Java 1.4.2_11 on both boxes.

I stripped everything out to just test getting an email sent, so here is my code (using sample found here: http://www.javacommerce.com/displaypage.jsp?name=javamail.sql&id=18274):



[ January 19, 2007: Message edited by: Jennifer Bhamoo ]
[ January 19, 2007: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64993
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to Other Java APIs where the JavaMail-savvy hang out.
 
Aaron Arakawa
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you may want to use Session.getInstance() instead of getDefaultInstance(). On your server if a default Session has already been created in the same JVM, it will ignore the properties containing mail.smtp.host = ... (according to the javadocs).
http://java.sun.com/products/javamail/javadocs/javax/mail/Session.html
 
Jennifer Bhamoo
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you thank you!!!

That worked, I have been staring at this for over a week now!!!

Thanks again,
Jennfier
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic