aspose file tools*
The moose likes Other Open Source Projects and the fly likes EmailException, sendMimeMessage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "EmailException, sendMimeMessage" Watch "EmailException, sendMimeMessage" New topic
Author

EmailException, sendMimeMessage

Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
Not really a servlet question...

I'm trying to understand why sendMimeMessage fails.


Sending the email to the following server failed : 127.0.0.1:25
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:873)
at org.apache.commons.mail.Email.send(Email.java:898)
at org.blojsom.plugin.comment.CommentPlugin.handleEvent(CommentPlugin.java:779)
at org.blojsom.event.SimpleEventBroadcaster$AsynchronousEventBroadcaster.run(SimpleEventBroadcaster.java:217)
at java.lang.Thread.run(Thread.java:613)
Caused by: javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.MessagingException: Could not connect to SMTP host: 127.0.0.1, port: 25;
nested exception is:
java.net.ConnectException: Connection refused
at javax.mail.Transport.send0(Transport.java:218)
at javax.mail.Transport.send(Transport.java:80)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:863)
[/CODE]
Caused by:

Read the docs. Googled it. Can't figure out why.


comp.lang.javascript FAQ: http://jibbering.com/faq/
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Is it not giving any more information ?

Is your SMTP server hosted in your local machine and listening at port 25 ?

Try telneting to your localhost at port 25 and see whether you are able to establish a successful connection with the server or not.


Rahul Bhattacharjee
LinkedIn - Blog
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
Hi Rahul.

Here is the result of your suggestion:

So I've established that I can't connect to 127.0.0.1:25. Have to find the reason. Is this a Mac issue?
Rashid Mayes
Ranch Hand

Joined: Jan 11, 2006
Posts: 160
The telnet command is incorrect. You need to specify the host and port separately.

telnet 127.0.0.1 25

In any case, since this is the local machine, you should

1) check to see if sendmail (or its equivalent is running), and check its port
2) check to see if a process is listening on port 25

What is your platform?


Rashid Mayes
http://www.hostj2me.com/ - http://www.worlddeveloper.org/
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Originally posted by Garrett Smith:

Here is the result of your suggestion:


Your telnet syntax seems to be wrong.Follow what Rashid Mayes has mentioned.

command prompt > telnet 127.0.0.1 25
 
 
subject: EmailException, sendMimeMessage