Date Created: Tue 27-Nov-2007

Related Document Categories:

Get my WebSphere Application Server course here >> http://www.themiddlewareshop.com/products/



    When trying to send an SMTP message using the JavaMail API you get the following error:

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


    Solution:


    The server you are using as an SMTP relay has security settings that deny the host you are sending from relaying SMTP through the server specified by the javax.mail properties in your class or session properties set on your WebLogic or WebSphere server.


    or


    Ensure your code specifies the 'From' field in the Java Class as often certain SMTP server will try to look up the senders email address in DNS or will discard of there is no 'From' details in the SMTP header etc.


    or


    in WebLogic you can set the Servers - Mail - Configuration to set global mail session properties.


    Get my WebSphere Application Server course here >> http://www.themiddlewareshop.com/products/


Steve Robinson - IBM Champion 2013

About Me

Steve Robinson has been working in IT for over 20 years and has provided solutions for many large-enterprise corporate companies across the world. Steve specialises in Java and Middleware.

In January 2013, I was awarded the prestigous 'IBM Champion' accolade.


Read my books?

IBM WebSphere Application Server 8.0 Administration Guide

IBM WebSphere Application Server 8.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Categories

Other Categories