Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

set return path in MimeMessage

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Jilani Jidni
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Rubel,

Thanks for your reply.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic