Solved

javamail Envelope From

Posted on 2001-08-17
2
858 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
diffSum example 4 50
Why my table column Id is not passed to java object? 4 44
ejb wildfly example 2 20
jsp login check 12 42
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…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

840 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