Rich,

Thank you for your reply. I have followed  what you suggested. Modified the
SMTPTransport Gbean definition by adding the properties.

 Here is the SMTPTransport Gbean defination.

<module name="geronimo/javamail/1.1.1/car">
    <gbean name="SMTPTransport">
      <attribute name="host">localhost</attribute>
      <attribute name="port">25</attribute>
      <attribute name="properties">mail.debug=true
            mail.smtp.quitwait=true</attribute>
    </gbean>

Now I am getting the following exception

exception

javax.servlet.ServletException: java.net.SocketTimeoutException: Read timed
out
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(
PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(
PageContextImpl.java:791)
    org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:138)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
    org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:332)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:688)

root cause

javax.mail.MessagingException: java.net.SocketTimeoutException: Read timed
out
org.apache.geronimo.javamail.transport.smtp.SMTPTransport.receiveLine(
SMTPTransport.java:1774)
org.apache.geronimo.javamail.transport.smtp.SMTPTransport.receiveLine(
SMTPTransport.java:1699)
org.apache.geronimo.javamail.transport.smtp.SMTPTransport.getReply(
SMTPTransport.java:1709)
org.apache.geronimo.javamail.transport.smtp.SMTPTransport.sendCommand(
SMTPTransport.java:1672)
org.apache.geronimo.javamail.transport.smtp.SMTPTransport.sendQuit(
SMTPTransport.java:1449)
org.apache.geronimo.javamail.transport.smtp.SMTPTransport.close(
SMTPTransport.java:725)
    javax.mail.Transport.send(Transport.java:142)
    javax.mail.Transport.send(Transport.java:46)
    org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:84)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
    org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:332)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:688)

Can you plese provide you expert advise and solution to solve this case. I
appreciate your help.

Thanks in advance.

regards,
Ashok

On 7/26/07, Rick McGuire <[EMAIL PROTECTED]> wrote:
>
> You might try setting the "mail.debug" property in the Geronimo mail
> session configuration to see what the traffic between the client and the
> server look like.
>
> Also, please include the version of Geronimo you're running with, as
> potential solutions can differ with the version involved.
>
> Rick
>
> ASHOK PORALU wrote:
> > Hi,
> >
> >  I am using Apache Geronimo's  default  JavaMail session and Apache
> > JAMES smtp server to send mails  from my application. As per JSP code
> > I am able see the result as message sent but I have not received any
> > mails to destination mail account.
> >
> > Here is the JSP code.
> >
> > <[EMAIL PROTECTED] import="java.util.Date,
> >                 javax.mail.Message,
> >                 javax.mail.Session,
> >                 javax.mail.Transport,
> >                 javax.mail.internet.InternetAddress ,
> >                 javax.mail.internet.MimeMessage,
> >                 javax.naming.InitialContext" %>
> >
> > <%
> >     String resultMsg = "";
> >     String action = request.getParameter("action");
> >     if ("Send".equals(action)) {
> >         String from = request.getParameter("from");
> >         String to = request.getParameter("to");
> >         String subject = request.getParameter ("subject");
> >         String content = request.getParameter("message");
> >
> >         // Get mail session and transport
> >         InitialContext context = new InitialContext();
> >         // Mail session from web.xml's resource reference
> >         Session mailSession = (Session)
> > context.lookup("java:comp/env/mail/testMailSession");
> >         Transport transport = mailSession.getTransport("smtp");
> >
> >         // Setup message
> >         MimeMessage message = new MimeMessage(mailSession);
> >         // From address
> >         message.setFrom(new InternetAddress(from));
> >         // To address
> >         message.addRecipient (Message.RecipientType.TO
> > <http://Message.RecipientType.TO>, new InternetAddress(to));
> >         // Subject
> >         message.setSubject (subject);
> >         // Content
> >         message.setText(content);
> >
> >         // Send message
> >         transport.connect();
> >         transport.send(message);
> >
> >         // Build result message
> >         resultMsg = "<b>Result:</b>";
> >         resultMsg += "<br>Message sent: " + new Date();
> >         resultMsg += "<br>To: " + to;
> >         resultMsg += "<br>From: " + from;
> >     }
> > %>
> >
> > <html>
> >     <head>
> >         <title>Send Mail</title>
> >     </head>
> >     <body>
> >         <form>
> >             <table>
> >                 <tr>
> >                     <td align="center" colspan="2"><b>Send Mail</b></td>
> >                 </tr>
> >                 <tr>
> >                     <td align="right">From:</td>
> >                     <td><input type="text" name="from"></td>
> >                 </tr>
> >                 <tr>
> >                     <td align="right">To:</td>
> >                     <td><input type="text" name="to"></td>
> >                 </tr>
> >                 <tr>
> >                     <td align="right">Subject:</td>
> >                     <td><input type="text" name="subject"></td>
> >                 </tr>
> >                 <tr>
> >                     <td align="right">Message:</td>
> >                     <td><textarea rows="5" cols="20"
> > name="message"></textarea></td>
> >                 </tr>
> >                 <tr>
> >                     <td align="right" colspan="2">
> >                         <input type="submit" name="action"
> > value="Send">&nbsp;<input type="reset"></td>
> >                     </td>
> >                 </tr>
> >             </table>
> >         </form>
> >         <%= resultMsg %>
> >     </body>
> > </html>
> >
> > Can anyone provide advice or solution to this case. I appreciate your
> > help.
> >
> > Thanks in advance
> >
> > regards,
> > Ashok
>
>

Reply via email to