The moose likes Spring and the fly likes Send mail not working in Spring/Maven/Java 6 environment Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Spring
Reply Bookmark "Send mail not working in Spring/Maven/Java 6 environment" Watch "Send mail not working in Spring/Maven/Java 6 environment" New topic
Author

Send mail not working in Spring/Maven/Java 6 environment

Rohit Mehta
Ranch Hand

Joined: Mar 11, 2005
Posts: 77

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
.


I am stuck. Is this due to Maven? Please suggest.


- Rohit
 
IntelliJ Java IDE
 
subject: Send mail not working in Spring/Maven/Java 6 environment
 
Threads others viewed
Not able to send mail in a Maven/Spring project (with otherwise working code)
Java Mail
javamail question!
Sending mail with authentication to Exchange Server 2007
the mails are goes to Badmail folder of the host
MyEclipse, The Clear Choice