Running in tomcat 6.x?

Any chance there is a jndi and smtp config setup in tomcat that is
messing with this?  Post the code for the sendMail method and any custom
code it calls.

review your web.xml and tomcat configurations for smtp related stuff.

David Smith wrote:
> Seems to me the important part of this is the sendMail method.  Could
> you post that?
> 
> --David
> 
> Fabio Rossi wrote:
>> Hi. I'll try to explain my problem, that is about sending an email
>> with JavaMail API from a servlet. Anyway, it seems to be a more
>> general problem i'm having with servlet. I'm using Tomcat 5.0. I've a
>> servlet that process a request, writes to a database some info and
>> then send a email with a summary to the user.
>>
>> In the method sendMail() i send the email. I test the method in
>> isolation and it works fine. I can connect to my local smtp server and
>> send the email...
>> Here's the code:
>>
>> do some stuff.....and send the email
>>
>> logInfo("Sending summary email");
>>         sendMail(summary.toString(),clientEmail);
>>         response.setStatus(HttpServletResponse.SC_OK);
>>         logInfo("Email sent");
>>         }catch(Exception e){
>>             logError("Error sending summary mail to address:
>> "+clientEmail,e);
>>             e.printStackTrace();
>>         }
>>     }
>>
>> No exceptions are throwed...but it seems that the servlet doesn't
>> "wait" for the method. When i test the method in isolation, it takes
>> some seconds before the mail is sent, and in the smtp local server
>> application i can see that a connection has been established.
>> If i call the same code (the sendMail method) from the servlet i get
>> "Email Sent" log messagge immediately and the servlet "exit"..like if
>> the message was sent. But nothing has happened (no connection is
>> established with the local smtp server) and no exception is thrown..
>>
>>
>> Anyone can help me?
>>
>>
>>            ---------------------------------
>>
>> ---------------------------------
>> L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail
>>   
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to