Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EmailException, sendMimeMessage

 
Garrett Smith
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Garrett Smith
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic