geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick McGuire <rick...@gmail.com>
Subject Re: Cannot send email using geronimo default email session
Date Tue, 22 Jul 2008 17:09:25 GMT
Does your server require an SSL connection?  The transport has connected 
ok, but has not received a response back from the server for the initial 
welcome reply.  This sort of points in the direction of perhaps needed 
to use the "smtps" protocol rather than "smtp".

Rick


metamor wrote:
> Thank you very much, your solution fixed my problem. 
> Now I have another issue, I am trying to connect to our smtp with
> authentication, this is the code that I am using:
>
> InitialContext context = new InitialContext();
> // Mail session from web.xml's resource reference
> Session mailSession = (Session)
> context.lookup("java:comp/env/mail/kickappsMailSession");
> mailSession.getProperties().put("mail.smtp.auth", "true");
>
> Transport transport = mailSession.getTransport("smtp");
> transport.connect("mail.foo.com", "norepl12", "1norep21");
>
> MimeMessage message = new MimeMessage(mailSession);
> message.setFrom(new InternetAddress("metamor@foo.com"));
> message.addRecipient(Message.RecipientType.TO, new
> InternetAddress("metamor@gmail.com"));
> message.setSubject("test");
> message.setText("test");
> message.saveChanges();
> transport.send(message);
>
> In the Transport.connect() I am getting the following error:
>
> javax.mail.MessagingException: java.net.SocketTimeoutException: Read timed
> out
> 	at
> org.apache.geronimo.javamail.transport.smtp.SMTPTransport.receiveLine(SMTPTransport.java:1796)
> 	at
> org.apache.geronimo.javamail.transport.smtp.SMTPTransport.receiveLine(SMTPTransport.java:1716)
> 	at
> org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getReply(SMTPTransport.java:1726)
> 	at
> org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getWelcome(SMTPTransport.java:1385)
> 	at
> org.apache.geronimo.javamail.transport.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:389)
> 	at javax.mail.Service.connect(Service.java:271)
> 	at javax.mail.Service.connect(Service.java:91)
>
> Any ideas of what is wrong now? Thanks so much for your help!
>
>   


Mime
View raw message