Solved

javamail Envelope From

Posted on 2001-08-17
2
846 Views
Last Modified: 2013-11-24
Dear all:

I am using JavaMail1.2 package and want to specify a different return address for bounced (undeliverable) messages than the address of the
sender (which appearing as the value of the From: field, to which the normal reply of the message will return if Reply-To header is not set).

Message.setFrom(String) will set the value for From: field, but how can I set the value for the
envelope from, so that if when the mail is undeliverable, it will return to this Envelope From, rather than the one in the From: field?

Many Thanks,

0
Comment
Question by:kcwang7
2 Comments
 

Accepted Solution

by:
germuska earned 100 total points
ID: 7265762
I found the answer to this in Sun's Java forums at http://forum.java.sun.com/thread.jsp?forum=43&thread=74083

In short, the SMTP envelope isn't directly exposed in the API, but you can set a property on your javax.mail.Session object, "mail.smtp.from"  The value of that property will be used as the STMP Envelope From address.  Of course, that value sticks with the session, so use caution if you're sharing your session among several processes.

0
 

Expert Comment

by:SpideyMod
ID: 8289647
Force Accepted

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now