Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Email Forward

Hi,

I need to forward an email programmatically and need some code snippet to help.I have used message.forward and then Transport.send but it doesnt work like forwarded email.

 

Any idea?

Rujuta Trivedi
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Email Forward

You "create" the forward message like this:

 

        Message newMessage = m_message.forward();

 

Then you hame to set the email address to be forwarded to.


 

Developer
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: Email Forward

Thanks RexDoug for replying,

I have done the same thing and now I am getting mail like this.

------Original Message------
Sent: Dec 31, 1969 4:00 PM

 

The forwarded mail doesn't contain old subject and content even if setcontent it shows the content first and then the original msg phrase(empty).

Rujuta Trivedi
Developer
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: Email Forward

Anyone who can Help?

Rujuta Trivedi
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Email Forward

When I create a "forward" copy of the email, the original content is there and the subject is brought over to the new email with this "RE:" tag at the beginning.

 

RE: Original Subject

 

What version are you testing on?

 

 

Developer
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: Email Forward

I am testing on torch-9800 os 6 and I am getting mail as mentioned in my previous message
Rujuta Trivedi
Developer
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: Email Forward

Please help!! I need to solve it 

Rujuta Trivedi
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Email Forward

Code snippet?

Developer
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: Email Forward

Hi,

Here is my code:

 

message=_message.forward();//_message is the Message object which has data to be forwarded
message.addRecipients(Message.RecipientType.TO, toList);
message.addRecipients(Message.RecipientType.CC, CCList);

Transport.send(message);

 

And when I send that email,I get like

 

------Original Message------
Sent: Jan 1, 1970 5:30 AM

 

No content is there nor any subject

Rujuta Trivedi
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Email Forward

[ Edited ]

Are you certain there is content and a subject on the original message?

 

This is the behavior I would expect if the original message was empty.