How to mask from email address with other email address in javamail
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Bhavesh_Patel
Posted On:   Tuesday, September 25, 2007 03:29 AM

We r using gmail as a smtp provider in our web application, and it works fine. For that we have to use
gmail email id for Authentication , so when some one reply to other person mail goes from our gmail account and it show our gmail email ID in Inbox of the recipient , so we have to change the header "from" address sent from gamil & instead of it we have to put the original replyer i.e, from address in the header of the mail. SO reciepient get
directly from address in his inbox .

So for this what we have to set in the header of mail .

Plz reply asap

Thanks

Re: How to mask from email address with other email address in javamail

Posted By:   em_titania  
Posted On:   Monday, November 26, 2007 01:10 PM

In your java code -- you need to set the 'return path' variable -- so when someone replies, it goes where you want it to go, and not necessarily back to you. This is distinct from the from_name and from_address, but will default to from_address if not set.



To do this, we use the following code:


String return_path = "email@address.com";
Properties systemSettings = System.getProperties();
systemSettings.put("mail.smtp.from", return_path);
Session session = Session.getDefaultInstance(systemSettings,null);

MimeMessage message = new MimeMessage(session);

...set all fields for the message...

Transport.send();


hope this helps.



em :-)

Re: How to mask from email address with other email address

Posted By:   Christopher_Koenigsberg  
Posted On:   Monday, October 8, 2007 07:50 PM

try setting the "Reply-To" header field. That's what it's for.
About | Sitemap | Contact