wood burning stoves 2.0*
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
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: set return path in MimeMessage
 
Similar Threads
how to detect a firewall
problem sending mail with spring javamailsender
Sending email from java. Pls Help!!!
Suppressing Applet alerts when using mail API
JavaMail application not making use of all the servers behind the smtp smarthost