javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25 (java.net.ConnectException: Connection refused))

QOS.ch JIRA | Jay Taylor | 6 years ago
  1. 0

    The following documentation appears to have some incorrect information: http://logback.qos.ch/manual/appenders.html#SMTPAppender The table includes a property named "smtpHost". Using this value results in logback ignoring the setting and attempting to send mail through localhost. The correct property name appears to be "SMTPHost". The documentation also states that the parameter is mandatory. It appears to fall back to localhost if it is not encountered (perhaps java-mail is doing that). I would assume that "smtpPort" is incorrect too based on the setter name of "SMTPPort" in SMTPAppenderBase. Log info: |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.net.SMTPAppender] |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [TEST] |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@22:13 - no applicable action for [smtpHost], current pattern is [[configuration][appender][smtpHost]] |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.net.SMTPAppender] ... |-ERROR in ch.qos.logback.classic.net.SMTPAppender[POR] - Error occured while sending e-mail notification. javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25 (java.net.ConnectException: Connection refused)) at javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25 (java.net.ConnectException: Connection refused)) at at javax.mail.Transport.send(Transport.java:163) at at javax.mail.Transport.send(Transport.java:48) at at ch.qos.logback.core.net.SMTPAppenderBase.sendBuffer(SMTPAppenderBase.java:323) at at ch.qos.logback.core.net.SMTPAppenderBase.append(SMTPAppenderBase.java:181) at at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:85)

    QOS.ch JIRA | 6 years ago | Jay Taylor
    javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25 (java.net.ConnectException: Connection refused))
  2. 0

    The following documentation appears to have some incorrect information: http://logback.qos.ch/manual/appenders.html#SMTPAppender The table includes a property named "smtpHost". Using this value results in logback ignoring the setting and attempting to send mail through localhost. The correct property name appears to be "SMTPHost". The documentation also states that the parameter is mandatory. It appears to fall back to localhost if it is not encountered (perhaps java-mail is doing that). I would assume that "smtpPort" is incorrect too based on the setter name of "SMTPPort" in SMTPAppenderBase. Log info: |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.net.SMTPAppender] |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [TEST] |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@22:13 - no applicable action for [smtpHost], current pattern is [[configuration][appender][smtpHost]] |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.net.SMTPAppender] ... |-ERROR in ch.qos.logback.classic.net.SMTPAppender[POR] - Error occured while sending e-mail notification. javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25 (java.net.ConnectException: Connection refused)) at javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25 (java.net.ConnectException: Connection refused)) at at javax.mail.Transport.send(Transport.java:163) at at javax.mail.Transport.send(Transport.java:48) at at ch.qos.logback.core.net.SMTPAppenderBase.sendBuffer(SMTPAppenderBase.java:323) at at ch.qos.logback.core.net.SMTPAppenderBase.append(SMTPAppenderBase.java:181) at at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:85)

    QOS.ch JIRA | 6 years ago | Jay Taylor
    javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25 (java.net.ConnectException: Connection refused))
  3. 0

    Send failure (javax.mail.MessagingException: Unable to obtain SASL authenticator)

    Stack Overflow | 2 years ago | Ajay
    javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Unable to obtain SASL authenticator)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Using OAuth SMTP to send mails without losing access to Google App Engine Mail

    Stack Overflow | 2 years ago | ArjunKumar
    javax.mail.SendFailedException: Send failure (com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1 (java.net.SocketException: Permission denied: Attempt to access a blocked recipient without permission.))
  6. 0

    Forward Email from Google App Engine

    Stack Overflow | 4 years ago | Patrice De Saint Steban
    javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Converting attachment data failed)

  1. abrazeneb 20 times, last 5 months ago
1 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. javax.mail.SendFailedException

    Send failure (javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25 (java.net.ConnectException: Connection refused))

    at javax.mail.Transport.send()
  2. JavaMail API
    Transport.send
    1. javax.mail.Transport.send(Transport.java:163)
    2. javax.mail.Transport.send(Transport.java:48)
    2 frames
  3. Logback Core Module
    AppenderBase.doAppend
    1. ch.qos.logback.core.net.SMTPAppenderBase.sendBuffer(SMTPAppenderBase.java:323)
    2. ch.qos.logback.core.net.SMTPAppenderBase.append(SMTPAppenderBase.java:181)
    3. ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:85)
    3 frames