?
Solved

javamail Envelope From

Posted on 2001-08-17
2
Medium Priority
?
889 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

How to Create Failover DNS Record Sets in Route 53

Route 53 has the ability to easily configure DNS record sets specifically for failover scenarios. These failover record sets can be configured to failover to full-blown deployments in other regions or to a static HTML page that informs your customers of the issue.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month8 days, 7 hours left to enroll

765 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