Skip to main content
Participant
September 16, 2013
Question

javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25; nested exception

  • September 16, 2013
  • 1 reply
  • 2708 views

Hi All,

We are getting this exception on our production servers (WIndows 2003) while sending emails using cfmail (ColdFusion 10) and local smtp server.

A problem occurred when attempting to deliver mail. This exception was caused by: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25; nested exception is: java.net.BindException: Address already in use: connect.

We are sending emails using cfmail (with spooling = "No" because we are sending email attachments which will be deleted after sometime)  and the email is not delivered to the users and we can see this exception in the application and in the Coldfusion mail logs as well  after upgrading. to CF10

It seems the Coldfusion is opening more number of sockets to send emails but the sockets are already in use.

In one click we will be sending around 20  to 50 emails including attachments and we are using local smtp server to send the emails..We don't see any logs related to this in the smtp logs and port 25 is only listening to SMTP server.

Please let me know how  to fix this issue? Is there anything to do with Coldfusion administrator settings Or SMTP server?

Regards,

Naresh

This topic has been closed for replies.

1 reply

Legend
September 17, 2013

Read this first and see if it is applicable: http://support.microsoft.com/kb/q196271

What mail server do you use? We use the free hMailServer for SMTP and find it very stable. Can you also also enable logging in your mail server to see what that says? It it doesn't have logging, consider changing mail server as logging is essential to diagnose email-related issues.

I don't think it is the CF Admin settings, as they are minimal. Can the CF Admin connect to the server? There is a test checkbox in the SMTP settings of the CF Admin. Also check the mail queue and do a test with a single email first.