This content has been marked as final.
Show 4 replies
-
1. Re: Unable to directly manipulate the FROM address in a Mail
gohip Oct 10, 2006 10:57 PM (in response to sappenin)I ran into a similar issue...I ended up copying the mail object, and manipulated the new/copied mail objects headers...I.e. for forwarding. It is a pain!
-
2. Re: Unable to directly manipulate the FROM address in a Mail
mikezzz Oct 12, 2006 1:21 PM (in response to sappenin)Does this work?
MailHeaders mh = mail.getHeaders(); mh.removeHeader("From"); mh.addHeader("From", "someone@whereever.com");
Note that removeHeader wills remove all headers with a given name, but there are normally only one called "From".
Mike. -
3. Re: Unable to directly manipulate the FROM address in a Mail
sappenin Oct 12, 2006 2:22 PM (in response to sappenin)Yep, I think that would work actually, especially since there's only supposed to be 1 FROM address. However, it would be nice to have this in a utility function (or in the setFrom() function).
This begs the questions: What about the rest of the fields? Is there any reason not to have everything in this object read/write? If so, shall I submit a patch?
david -
4. Re: Unable to directly manipulate the FROM address in a Mail
mikezzz Oct 14, 2006 5:50 AM (in response to sappenin)Sorry, I now see what you are talking about. I am revising all of the Mail APIs at the moment and I will look into including this.
Mike.