This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes set return path in MimeMessage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "set return path in MimeMessage" Watch "set return path in MimeMessage" New topic
Author

set return path in MimeMessage

Jilani Jidni
Greenhorn

Joined: Feb 06, 2007
Posts: 8
Hello everyone,

I was send mail by using javax.mail.internet.MimeMessage vi send mail. And its working. But when a email is bounce like email address is invalid then the bounce email aren't store into INBOX. May be its happening for setHeader return-path. I am trying to set it but its not working. Here is my code:

MimeMessage message = ((JavaMailSenderImpl) mailSender).createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(message, false);
helper.addTo("jidni@yahoo.com");
helper.setFrom(jidni@hotmail.com);
helper.setSubject("Test Mail");
message.setHeader("return-Path","test@testmail.local");
message.setContent(messageText, "text/html");
((JavaMailSenderImpl) mailSender).send(message);

please tell me what I am doing wrong.

Thanking you
Golam Jilani Jidni


With Regards<br /> Jilani Jidni<br /> Bangladesh
Rubel Ahammad
Greenhorn

Joined: Feb 05, 2005
Posts: 19
Hello Jidni,
I was also facing similar kind of problem. But at last i was able to track bounced mails by setting "mail.smtp.from" property to the desired email address.

As far as I know, You dont need to set reply path header to track bounced mail.

i.e.


Hope this will help.
thanks


rubel ahammad<br /> <br />SCJP 1.4 (91%)<br />SCWCD 1.4 (Preparing)
Jilani Jidni
Greenhorn

Joined: Feb 06, 2007
Posts: 8
Dear Rubel,

Thanks for your reply.
 
 
subject: set return path in MimeMessage