• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Mail exception

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what this exception means exactly.

javax.mail.MessagingException: Could not connect to SMTP host: fooserver, port: 25; nested exception is: java.net.ConnectException: Connection refused: connect


It looks like the nested exception is getting cut-off for some reason. I tried catching it separately, but javac said that ConnectException was not being thrown so I had to remove it.
Can someone more experienced with javax.mail or java.net give me a helpful pointer?
[ November 15, 2002: Message edited by: Michael Brewer ]
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well.. aside from the fact that a mail server probably wouldn't be "fooserver" ?

You'd be looking for your ISP's email server there... something like smtp.your_isp_name_here.com

As for JavaMail being quiet about the 'root' exception.. I've noticed that before. I'm not sure if there's a way to get more verbose messages from JavaMail. When I really think of it though.. most javamail / net exceptions probably don't NEED to be very verbose. It's mostly a configuration error that is to blame, and well.. it's kinda self-evident in most cases.

"connection refused". means fooserver on port 25 isn't answering your hail.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As long as fooserver is not your peoblem It could be also that your SMTP server requires Authentication. Therefor you would need to supply a username and password to access the SMTP server.
Here is a link to the JGuru Java Mail tutorial that talks about the Authenticator and how to use it. Hope that helps.
reply
    Bookmark Topic Watch Topic
  • New Topic