permaculture playing cards*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "EmailException, sendMimeMessage" Watch "EmailException, sendMimeMessage" New topic

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 :
at org.apache.commons.mail.Email.sendMimeMessage(
at org.apache.commons.mail.Email.send(
at org.blojsom.plugin.comment.CommentPlugin.handleEvent(
at org.blojsom.event.SimpleEventBroadcaster$
Caused by: javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.MessagingException: Could not connect to SMTP host:, port: 25;
nested exception is: Connection refused
at javax.mail.Transport.send0(
at javax.mail.Transport.send(
at org.apache.commons.mail.Email.sendMimeMessage(
Caused by:

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

comp.lang.javascript 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 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 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 -
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 25
Consider Paul's rocket mass heater.
subject: EmailException, sendMimeMessage
Similar Threads
Sending Mail using Java
problem in sending mail
Intermittent "javax.mail.SendFailedException: Sending failed" error
JavaMail UnsupportedDataTypeException in custom ClassLoader
want to generate html formatted email that supports outlook?