Javamail from Tomcat

Hello. I have a servlet that must send an email after some data has been processed.

I'm my method sendMail(....) i send this mail.

The method sendMail works perfectly. If I test the method in isolation everything works fine and the mail is sent.

The problem that, in the servlet, the method simply does nothig.

No exceptions are thrown. In the method, at a certain point, i do:

System.out.println("Sending mail");

SMTPTransport.send(message);

System.out.println("Mail sent");

.....

I invoke the servlet and the output is:

Sending mail.. and immediately after MailSent. When i test the method in isolation it takes a little bit of time before the message is sent and "mail sent" is prompted. It's like SMTPTransport returns immediately without sending the mail and without raising any exception.... It's too weird!!! pleas help

Thanks and sorry for my english

[934 byte] By [Paranoid_Fabioa] at [2007-11-27 11:57:27]
# 1

As a matter of style, you almost never need to use the SMTPTransport

class directly, so you should use "Transport.send" instead of

"SMTPTransport.send", although they're both the same static method.

Turn on session debugging and examine the protocol trace. It might

tell you what's going wrong. See the JavaMail FAQ.

bshannona at 2007-7-29 19:14:00 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...