You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Geist Alexander (JIRA)" <ji...@apache.org> on 2007/01/02 00:45:27 UTC

[jira] Created: (GERONIMO-2682) Sending a message throws a SendFailedException

Sending a message throws a SendFailedException
----------------------------------------------

                 Key: GERONIMO-2682
                 URL: http://issues.apache.org/jira/browse/GERONIMO-2682
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
          Components: mail
    Affects Versions: 2.0-M1
            Reporter: Geist Alexander


       // Get system properties
       Properties props = System.getProperties();

       // Setup mail server
       props.put("mail.smtp.host", Settings.smtpServer);
       props.put("mail.imap.partialfetch", "false");
       props.put("mail.smtp.auth", "true");

       Authenticator auth = new Authenticator()
       {
           protected PasswordAuthentication getPasswordAuthentication()
           {
               return new PasswordAuthentication(Settings.user, Settings.key);
           }
       };
             return Session.getDefaultInstance(props, auth);

The method was used to get the session. It works.
Next step is to build and to send the message.

       // Define message
       MimeMessage message = new MimeMessage(mailParam.getSession());

       // Set the from address
       message.setFrom(new InternetAddress(Settings.from));

       // Empfänger
       message.addRecipient(Message.RecipientType.TO, new InternetAddress(mailParam.getMailAddress()));

       // Set the subject
       message.setSubject("Subject");

       BodyPart messageBodyPart = new MimeBodyPart();
             String text = getEmailText(mailParam.getXmgKey(),mailParam.getXlgKey(), mailParam.getDate());
             messageBodyPart.setContent(text, "text/html");
             Multipart multipart = new MimeMultipart();
       multipart.addBodyPart(messageBodyPart);

       // Put parts in message
       message.setContent(multipart);

       // Send message
       Transport.send(message);

Transport.send(message) is throwing this Exception

javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Connection error (java.net.ConnectException: Connection refused: connect))
   at javax.mail.Transport.send(Transport.java:163)
   at javax.mail.Transport.send(Transport.java:48)
   at keygen.main.MailSender.sendMail(MailSender.java:44)
   at keygen.main.MailSender.main(MailSender.java:112)
Caused by: javax.mail.MessagingException: Connection error (java.net.ConnectException: Connection refused: connect)
   at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:403)
   at javax.mail.Service.connect(Service.java:254)
   at javax.mail.Service.connect(Service.java:85)
   at javax.mail.Service.connect(Service.java:70)
   at javax.mail.Transport.send(Transport.java:94)
   ... 3 more
Caused by: java.net.ConnectException: Connection refused: connect
   at java.net.PlainSocketImpl.socketConnect(Native Method)
   at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
   at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
   at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
   at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
   at java.net.Socket.connect(Socket.java:519)
   at java.net.Socket.connect(Socket.java:469)
   at java.net.Socket.<init>(Socket.java:366)
   at java.net.Socket.<init>(Socket.java:239)
   at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getConnectedSocket(SMTPTransport.java:1091)
   at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getConnection(SMTPTransport.java:851)
   at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:380)
   ... 7 more 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Updated: (GERONIMO-2682) Sending a message throws a SendFailedException

Posted by "Jason Warner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-2682?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Warner updated GERONIMO-2682:
-----------------------------------

    Affects Version/s:     (was: 2.0-M1)
                       2.0.x
        Fix Version/s: 2.0.x

> Sending a message throws a SendFailedException
> ----------------------------------------------
>
>                 Key: GERONIMO-2682
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-2682
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>    Affects Versions: 2.0.x
>            Reporter: Geist Alexander
>            Assignee: Jason Warner
>             Fix For: 2.0.x
>
>
>        // Get system properties
>        Properties props = System.getProperties();
>        // Setup mail server
>        props.put("mail.smtp.host", Settings.smtpServer);
>        props.put("mail.imap.partialfetch", "false");
>        props.put("mail.smtp.auth", "true");
>        Authenticator auth = new Authenticator()
>        {
>            protected PasswordAuthentication getPasswordAuthentication()
>            {
>                return new PasswordAuthentication(Settings.user, Settings.key);
>            }
>        };
>              return Session.getDefaultInstance(props, auth);
> The method was used to get the session. It works.
> Next step is to build and to send the message.
>        // Define message
>        MimeMessage message = new MimeMessage(mailParam.getSession());
>        // Set the from address
>        message.setFrom(new InternetAddress(Settings.from));
>        // Empfänger
>        message.addRecipient(Message.RecipientType.TO, new InternetAddress(mailParam.getMailAddress()));
>        // Set the subject
>        message.setSubject("Subject");
>        BodyPart messageBodyPart = new MimeBodyPart();
>              String text = getEmailText(mailParam.getXmgKey(),mailParam.getXlgKey(), mailParam.getDate());
>              messageBodyPart.setContent(text, "text/html");
>              Multipart multipart = new MimeMultipart();
>        multipart.addBodyPart(messageBodyPart);
>        // Put parts in message
>        message.setContent(multipart);
>        // Send message
>        Transport.send(message);
> Transport.send(message) is throwing this Exception
> javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Connection error (java.net.ConnectException: Connection refused: connect))
>    at javax.mail.Transport.send(Transport.java:163)
>    at javax.mail.Transport.send(Transport.java:48)
>    at keygen.main.MailSender.sendMail(MailSender.java:44)
>    at keygen.main.MailSender.main(MailSender.java:112)
> Caused by: javax.mail.MessagingException: Connection error (java.net.ConnectException: Connection refused: connect)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:403)
>    at javax.mail.Service.connect(Service.java:254)
>    at javax.mail.Service.connect(Service.java:85)
>    at javax.mail.Service.connect(Service.java:70)
>    at javax.mail.Transport.send(Transport.java:94)
>    ... 3 more
> Caused by: java.net.ConnectException: Connection refused: connect
>    at java.net.PlainSocketImpl.socketConnect(Native Method)
>    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>    at java.net.Socket.connect(Socket.java:519)
>    at java.net.Socket.connect(Socket.java:469)
>    at java.net.Socket.<init>(Socket.java:366)
>    at java.net.Socket.<init>(Socket.java:239)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getConnectedSocket(SMTPTransport.java:1091)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getConnection(SMTPTransport.java:851)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:380)
>    ... 7 more 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (GERONIMO-2682) Sending a message throws a SendFailedException

Posted by "Jason Warner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-2682?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Warner reassigned GERONIMO-2682:
--------------------------------------

    Assignee: Jason Warner

> Sending a message throws a SendFailedException
> ----------------------------------------------
>
>                 Key: GERONIMO-2682
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-2682
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>    Affects Versions: 2.0-M1
>            Reporter: Geist Alexander
>         Assigned To: Jason Warner
>
>        // Get system properties
>        Properties props = System.getProperties();
>        // Setup mail server
>        props.put("mail.smtp.host", Settings.smtpServer);
>        props.put("mail.imap.partialfetch", "false");
>        props.put("mail.smtp.auth", "true");
>        Authenticator auth = new Authenticator()
>        {
>            protected PasswordAuthentication getPasswordAuthentication()
>            {
>                return new PasswordAuthentication(Settings.user, Settings.key);
>            }
>        };
>              return Session.getDefaultInstance(props, auth);
> The method was used to get the session. It works.
> Next step is to build and to send the message.
>        // Define message
>        MimeMessage message = new MimeMessage(mailParam.getSession());
>        // Set the from address
>        message.setFrom(new InternetAddress(Settings.from));
>        // Empfänger
>        message.addRecipient(Message.RecipientType.TO, new InternetAddress(mailParam.getMailAddress()));
>        // Set the subject
>        message.setSubject("Subject");
>        BodyPart messageBodyPart = new MimeBodyPart();
>              String text = getEmailText(mailParam.getXmgKey(),mailParam.getXlgKey(), mailParam.getDate());
>              messageBodyPart.setContent(text, "text/html");
>              Multipart multipart = new MimeMultipart();
>        multipart.addBodyPart(messageBodyPart);
>        // Put parts in message
>        message.setContent(multipart);
>        // Send message
>        Transport.send(message);
> Transport.send(message) is throwing this Exception
> javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Connection error (java.net.ConnectException: Connection refused: connect))
>    at javax.mail.Transport.send(Transport.java:163)
>    at javax.mail.Transport.send(Transport.java:48)
>    at keygen.main.MailSender.sendMail(MailSender.java:44)
>    at keygen.main.MailSender.main(MailSender.java:112)
> Caused by: javax.mail.MessagingException: Connection error (java.net.ConnectException: Connection refused: connect)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:403)
>    at javax.mail.Service.connect(Service.java:254)
>    at javax.mail.Service.connect(Service.java:85)
>    at javax.mail.Service.connect(Service.java:70)
>    at javax.mail.Transport.send(Transport.java:94)
>    ... 3 more
> Caused by: java.net.ConnectException: Connection refused: connect
>    at java.net.PlainSocketImpl.socketConnect(Native Method)
>    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>    at java.net.Socket.connect(Socket.java:519)
>    at java.net.Socket.connect(Socket.java:469)
>    at java.net.Socket.<init>(Socket.java:366)
>    at java.net.Socket.<init>(Socket.java:239)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getConnectedSocket(SMTPTransport.java:1091)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getConnection(SMTPTransport.java:851)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:380)
>    ... 7 more 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (GERONIMO-2682) Sending a message throws a SendFailedException

Posted by "Joe Bohn (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-2682?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bohn resolved GERONIMO-2682.
--------------------------------

    Resolution: Invalid

There has been no activity on this issue for ages and others seem to be working fine.  I'm making a guess that this is no longer an issue.   If it is still an issue then please reopen.

> Sending a message throws a SendFailedException
> ----------------------------------------------
>
>                 Key: GERONIMO-2682
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-2682
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>    Affects Versions: 2.0.1
>            Reporter: Geist Alexander
>
>        // Get system properties
>        Properties props = System.getProperties();
>        // Setup mail server
>        props.put("mail.smtp.host", Settings.smtpServer);
>        props.put("mail.imap.partialfetch", "false");
>        props.put("mail.smtp.auth", "true");
>        Authenticator auth = new Authenticator()
>        {
>            protected PasswordAuthentication getPasswordAuthentication()
>            {
>                return new PasswordAuthentication(Settings.user, Settings.key);
>            }
>        };
>              return Session.getDefaultInstance(props, auth);
> The method was used to get the session. It works.
> Next step is to build and to send the message.
>        // Define message
>        MimeMessage message = new MimeMessage(mailParam.getSession());
>        // Set the from address
>        message.setFrom(new InternetAddress(Settings.from));
>        // Empfänger
>        message.addRecipient(Message.RecipientType.TO, new InternetAddress(mailParam.getMailAddress()));
>        // Set the subject
>        message.setSubject("Subject");
>        BodyPart messageBodyPart = new MimeBodyPart();
>              String text = getEmailText(mailParam.getXmgKey(),mailParam.getXlgKey(), mailParam.getDate());
>              messageBodyPart.setContent(text, "text/html");
>              Multipart multipart = new MimeMultipart();
>        multipart.addBodyPart(messageBodyPart);
>        // Put parts in message
>        message.setContent(multipart);
>        // Send message
>        Transport.send(message);
> Transport.send(message) is throwing this Exception
> javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Connection error (java.net.ConnectException: Connection refused: connect))
>    at javax.mail.Transport.send(Transport.java:163)
>    at javax.mail.Transport.send(Transport.java:48)
>    at keygen.main.MailSender.sendMail(MailSender.java:44)
>    at keygen.main.MailSender.main(MailSender.java:112)
> Caused by: javax.mail.MessagingException: Connection error (java.net.ConnectException: Connection refused: connect)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:403)
>    at javax.mail.Service.connect(Service.java:254)
>    at javax.mail.Service.connect(Service.java:85)
>    at javax.mail.Service.connect(Service.java:70)
>    at javax.mail.Transport.send(Transport.java:94)
>    ... 3 more
> Caused by: java.net.ConnectException: Connection refused: connect
>    at java.net.PlainSocketImpl.socketConnect(Native Method)
>    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>    at java.net.Socket.connect(Socket.java:519)
>    at java.net.Socket.connect(Socket.java:469)
>    at java.net.Socket.<init>(Socket.java:366)
>    at java.net.Socket.<init>(Socket.java:239)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getConnectedSocket(SMTPTransport.java:1091)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getConnection(SMTPTransport.java:851)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:380)
>    ... 7 more 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (GERONIMO-2682) Sending a message throws a SendFailedException

Posted by "Joe Bohn (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-2682?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bohn updated GERONIMO-2682:
-------------------------------

    Affects Version/s:     (was: 2.0.x)
                       2.0.1
        Fix Version/s:     (was: 2.0.x)

> Sending a message throws a SendFailedException
> ----------------------------------------------
>
>                 Key: GERONIMO-2682
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-2682
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>    Affects Versions: 2.0.1
>            Reporter: Geist Alexander
>
>        // Get system properties
>        Properties props = System.getProperties();
>        // Setup mail server
>        props.put("mail.smtp.host", Settings.smtpServer);
>        props.put("mail.imap.partialfetch", "false");
>        props.put("mail.smtp.auth", "true");
>        Authenticator auth = new Authenticator()
>        {
>            protected PasswordAuthentication getPasswordAuthentication()
>            {
>                return new PasswordAuthentication(Settings.user, Settings.key);
>            }
>        };
>              return Session.getDefaultInstance(props, auth);
> The method was used to get the session. It works.
> Next step is to build and to send the message.
>        // Define message
>        MimeMessage message = new MimeMessage(mailParam.getSession());
>        // Set the from address
>        message.setFrom(new InternetAddress(Settings.from));
>        // Empfänger
>        message.addRecipient(Message.RecipientType.TO, new InternetAddress(mailParam.getMailAddress()));
>        // Set the subject
>        message.setSubject("Subject");
>        BodyPart messageBodyPart = new MimeBodyPart();
>              String text = getEmailText(mailParam.getXmgKey(),mailParam.getXlgKey(), mailParam.getDate());
>              messageBodyPart.setContent(text, "text/html");
>              Multipart multipart = new MimeMultipart();
>        multipart.addBodyPart(messageBodyPart);
>        // Put parts in message
>        message.setContent(multipart);
>        // Send message
>        Transport.send(message);
> Transport.send(message) is throwing this Exception
> javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Connection error (java.net.ConnectException: Connection refused: connect))
>    at javax.mail.Transport.send(Transport.java:163)
>    at javax.mail.Transport.send(Transport.java:48)
>    at keygen.main.MailSender.sendMail(MailSender.java:44)
>    at keygen.main.MailSender.main(MailSender.java:112)
> Caused by: javax.mail.MessagingException: Connection error (java.net.ConnectException: Connection refused: connect)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:403)
>    at javax.mail.Service.connect(Service.java:254)
>    at javax.mail.Service.connect(Service.java:85)
>    at javax.mail.Service.connect(Service.java:70)
>    at javax.mail.Transport.send(Transport.java:94)
>    ... 3 more
> Caused by: java.net.ConnectException: Connection refused: connect
>    at java.net.PlainSocketImpl.socketConnect(Native Method)
>    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>    at java.net.Socket.connect(Socket.java:519)
>    at java.net.Socket.connect(Socket.java:469)
>    at java.net.Socket.<init>(Socket.java:366)
>    at java.net.Socket.<init>(Socket.java:239)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getConnectedSocket(SMTPTransport.java:1091)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getConnection(SMTPTransport.java:851)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:380)
>    ... 7 more 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (GERONIMO-2682) Sending a message throws a SendFailedException

Posted by "Jason Warner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-2682?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Warner reassigned GERONIMO-2682:
--------------------------------------

    Assignee:     (was: Jason Warner)

> Sending a message throws a SendFailedException
> ----------------------------------------------
>
>                 Key: GERONIMO-2682
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-2682
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>    Affects Versions: 2.0.x
>            Reporter: Geist Alexander
>             Fix For: 2.0.x
>
>
>        // Get system properties
>        Properties props = System.getProperties();
>        // Setup mail server
>        props.put("mail.smtp.host", Settings.smtpServer);
>        props.put("mail.imap.partialfetch", "false");
>        props.put("mail.smtp.auth", "true");
>        Authenticator auth = new Authenticator()
>        {
>            protected PasswordAuthentication getPasswordAuthentication()
>            {
>                return new PasswordAuthentication(Settings.user, Settings.key);
>            }
>        };
>              return Session.getDefaultInstance(props, auth);
> The method was used to get the session. It works.
> Next step is to build and to send the message.
>        // Define message
>        MimeMessage message = new MimeMessage(mailParam.getSession());
>        // Set the from address
>        message.setFrom(new InternetAddress(Settings.from));
>        // Empfänger
>        message.addRecipient(Message.RecipientType.TO, new InternetAddress(mailParam.getMailAddress()));
>        // Set the subject
>        message.setSubject("Subject");
>        BodyPart messageBodyPart = new MimeBodyPart();
>              String text = getEmailText(mailParam.getXmgKey(),mailParam.getXlgKey(), mailParam.getDate());
>              messageBodyPart.setContent(text, "text/html");
>              Multipart multipart = new MimeMultipart();
>        multipart.addBodyPart(messageBodyPart);
>        // Put parts in message
>        message.setContent(multipart);
>        // Send message
>        Transport.send(message);
> Transport.send(message) is throwing this Exception
> javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Connection error (java.net.ConnectException: Connection refused: connect))
>    at javax.mail.Transport.send(Transport.java:163)
>    at javax.mail.Transport.send(Transport.java:48)
>    at keygen.main.MailSender.sendMail(MailSender.java:44)
>    at keygen.main.MailSender.main(MailSender.java:112)
> Caused by: javax.mail.MessagingException: Connection error (java.net.ConnectException: Connection refused: connect)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:403)
>    at javax.mail.Service.connect(Service.java:254)
>    at javax.mail.Service.connect(Service.java:85)
>    at javax.mail.Service.connect(Service.java:70)
>    at javax.mail.Transport.send(Transport.java:94)
>    ... 3 more
> Caused by: java.net.ConnectException: Connection refused: connect
>    at java.net.PlainSocketImpl.socketConnect(Native Method)
>    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>    at java.net.Socket.connect(Socket.java:519)
>    at java.net.Socket.connect(Socket.java:469)
>    at java.net.Socket.<init>(Socket.java:366)
>    at java.net.Socket.<init>(Socket.java:239)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getConnectedSocket(SMTPTransport.java:1091)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getConnection(SMTPTransport.java:851)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:380)
>    ... 7 more 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-2682) Sending a message throws a SendFailedException

Posted by "Vamsavardhana Reddy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-2682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12567414#action_12567414 ] 

Vamsavardhana Reddy commented on GERONIMO-2682:
-----------------------------------------------

Looks like the connection to smtp server could not be established.  Are you able to use the same smtp server to send mail from any other mail software?

> Sending a message throws a SendFailedException
> ----------------------------------------------
>
>                 Key: GERONIMO-2682
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-2682
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>    Affects Versions: 2.0.x
>            Reporter: Geist Alexander
>             Fix For: 2.0.x
>
>
>        // Get system properties
>        Properties props = System.getProperties();
>        // Setup mail server
>        props.put("mail.smtp.host", Settings.smtpServer);
>        props.put("mail.imap.partialfetch", "false");
>        props.put("mail.smtp.auth", "true");
>        Authenticator auth = new Authenticator()
>        {
>            protected PasswordAuthentication getPasswordAuthentication()
>            {
>                return new PasswordAuthentication(Settings.user, Settings.key);
>            }
>        };
>              return Session.getDefaultInstance(props, auth);
> The method was used to get the session. It works.
> Next step is to build and to send the message.
>        // Define message
>        MimeMessage message = new MimeMessage(mailParam.getSession());
>        // Set the from address
>        message.setFrom(new InternetAddress(Settings.from));
>        // Empfänger
>        message.addRecipient(Message.RecipientType.TO, new InternetAddress(mailParam.getMailAddress()));
>        // Set the subject
>        message.setSubject("Subject");
>        BodyPart messageBodyPart = new MimeBodyPart();
>              String text = getEmailText(mailParam.getXmgKey(),mailParam.getXlgKey(), mailParam.getDate());
>              messageBodyPart.setContent(text, "text/html");
>              Multipart multipart = new MimeMultipart();
>        multipart.addBodyPart(messageBodyPart);
>        // Put parts in message
>        message.setContent(multipart);
>        // Send message
>        Transport.send(message);
> Transport.send(message) is throwing this Exception
> javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Connection error (java.net.ConnectException: Connection refused: connect))
>    at javax.mail.Transport.send(Transport.java:163)
>    at javax.mail.Transport.send(Transport.java:48)
>    at keygen.main.MailSender.sendMail(MailSender.java:44)
>    at keygen.main.MailSender.main(MailSender.java:112)
> Caused by: javax.mail.MessagingException: Connection error (java.net.ConnectException: Connection refused: connect)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:403)
>    at javax.mail.Service.connect(Service.java:254)
>    at javax.mail.Service.connect(Service.java:85)
>    at javax.mail.Service.connect(Service.java:70)
>    at javax.mail.Transport.send(Transport.java:94)
>    ... 3 more
> Caused by: java.net.ConnectException: Connection refused: connect
>    at java.net.PlainSocketImpl.socketConnect(Native Method)
>    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>    at java.net.Socket.connect(Socket.java:519)
>    at java.net.Socket.connect(Socket.java:469)
>    at java.net.Socket.<init>(Socket.java:366)
>    at java.net.Socket.<init>(Socket.java:239)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getConnectedSocket(SMTPTransport.java:1091)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getConnection(SMTPTransport.java:851)
>    at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:380)
>    ... 7 more 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.