Solved

javamail Envelope From

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Increment alphanumeric sequence 6 80
Books that can get me started on JAVA 2 54
topping3 challenge 14 50
Java Jpanels and Jframe 8 20
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…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
The viewer will learn how to implement Singleton Design Pattern in Java.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

706 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

19 Experts available now in Live!

Get 1:1 Help Now