Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

javamail Envelope From

Posted on 2001-08-17
2
Medium Priority
?
900 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
germuska earned 300 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

604 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