Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 415 invoked from network); 23 Jul 2008 21:18:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Jul 2008 21:18:25 -0000 Received: (qmail 75462 invoked by uid 500); 23 Jul 2008 21:18:23 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 75401 invoked by uid 500); 23 Jul 2008 21:18:23 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 75390 invoked by uid 99); 23 Jul 2008 21:18:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jul 2008 14:18:23 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jul 2008 21:17:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9D7D1234C17C for ; Wed, 23 Jul 2008 14:17:31 -0700 (PDT) Message-ID: <200506904.1216847851642.JavaMail.jira@brutus> Date: Wed, 23 Jul 2008 14:17:31 -0700 (PDT) From: "Joe Bohn (JIRA)" To: dev@geronimo.apache.org Subject: [jira] Resolved: (GERONIMO-2682) Sending a message throws a SendFailedException In-Reply-To: <28117125.1167695127668.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/GERONIMO-2682?page=3Dcom.atlas= sian.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 wor= king 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)=20 > Components: mail > Affects Versions: 2.0.1 > Reporter: Geist Alexander > > // Get system properties > Properties props =3D 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 =3D 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 =3D new MimeMessage(mailParam.getSession()); > // Set the from address > message.setFrom(new InternetAddress(Settings.from)); > // Empf=C3=A4nger > message.addRecipient(Message.RecipientType.TO, new InternetAddress= (mailParam.getMailAddress())); > // Set the subject > message.setSubject("Subject"); > BodyPart messageBodyPart =3D new MimeBodyPart(); > String text =3D getEmailText(mailParam.getXmgKey(),mailParam= .getXlgKey(), mailParam.getDate()); > messageBodyPart.setContent(text, "text/html"); > Multipart multipart =3D 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.MessagingExcepti= on: Connection error (java.net.ConnectException: Connection refused: connec= t)) > 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.Conn= ectException: Connection refused: connect) > at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.protocolC= onnect(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.(Socket.java:366) > at java.net.Socket.(Socket.java:239) > at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getConnec= tedSocket(SMTPTransport.java:1091) > at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getConnec= tion(SMTPTransport.java:851) > at org.apache.geronimo.javamail.transport.smtp.SMTPTransport.protocolC= onnect(SMTPTransport.java:380) > ... 7 more=20 --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.