This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Hi all, I am using java 6.0, Spring 3.0 & Maven. I am facing a strange problem.
I am trying to send mail from my application, but not able to do so. I checked with debug on, the logs seems fine - no exception/error but the mail doesn't trigger.
POM (relevant):
Logs:
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.myorg.com", port 25, isSSL false
220 droutbound.logix.in ESMTP
DEBUG SMTP: connected to host "smtp.myorg.com", port: 25
EHLO ABCDE1234
250-droutbound.logix.in
250-8BITMIME
250-SIZE 26214400
250-STARTTLS
250-AUTH PLAIN LOGIN
250 AUTH=PLAIN LOGIN
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "SIZE", arg "26214400"
DEBUG SMTP: Found extension "STARTTLS", arg ""
DEBUG SMTP: Found extension "AUTH", arg "PLAIN LOGIN"
DEBUG SMTP: Found extension "AUTH=PLAIN", arg "LOGIN"
DEBUG SMTP: Attempt to authenticate
AUTH LOGIN
334 VXNl1cm25hbW2U6
c2NjYWRta1W5Ae3mVuc42Fy5Lmlu
334 UGFz7c63dv2cmQ6
WmVuc22Fy5MT7IzIw==
235 #2.0.0 OK Authenticated
DEBUG SMTP: use8bit false
MAIL FROM:<address@myorg.com> AUTH=address@myorg.com
250 sender <address@myorg.com> ok
RCPT TO:<address@myorg.com>
250 recipient <address@myorg.com> ok
DEBUG SMTP: Verified Addresses
DEBUG SMTP: address@myorg.com DATA
354 go ahead
Body .
250 ok: Message 325177010 accepted
QUIT
221 droutbound.logix.in
I have tried with other sample programs as well - with or without spring configurations. No error. BUT no mail as well.
IMP - same program(s) work fine if I use them in my other project which doesn't use maven - but otherwise have same configurations. In those logs there are some more lines in between ..
DATA
354 go ahead From: address@myorg.com To: address@myorg.com Message-ID: <12694833.01327427956033.JavaMail.myid@ABCDE12345>
Subject: Say Hi ..
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Body
.
Have tried other samples from net as well, but no luck. Seems Maven is not OK with something. Any suggestions are welcome.
From different points - main() within class, outside class & through application logic flow. From everywhere - the logs are same (without those 4/5 lines as mentioned - otherwise smooth) - but no mail.
If you'll notice, your message body on the failing email is ".".
Actually, that's a little suspicious, since you'd generally terminate an interactive email body with a single line with a "." on it, but I don't think that's supposed to apply here.
One thing that my be an issue, however, is that there are actually 2 jars required to send email. One is the jar with the javax.mail packages, the other is the activation.jar. It may be that activation.jar isn't getting pulled in.
Actually, you should have gone the other direction. The javamail facility is a standard component of J2EE, if I'm not mistaken, so all the full-stack servers have it, though the partial implementations such as Tomcat and Jetty do not.
You can include the standard javamail API with scope "provided" and build a WAR that should then properly run in Geronimo using the Geronimo facilities.
If you need to be able to test under Tomcat, you can set up separate Tomcat and Geronimo profiles so that the appropriate references are made for the desired target server.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Not able to send mail in a Maven/Spring project (with otherwise working code)