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

Native Development

Reply
Developer
BeroboInc
Posts: 123
Registered: ‎07-08-2011
My Device: Torch 9800, Bold 9700

Can't get incoming email message body.

I am trying to get Message m.body() to get the email body and it is fine for some emails but does not exist for others. 

 

I can easily duplicate the issue by sending an email through gmail. 

 

I have tried 

 

m.body(MessageBody::smileytongue:lainText).plainText()

 

and 

 

m.body(MessageBody::Html).plainText()

 

and also trying to see if its an attachment but attachment size = 0;

 

I assumed it was some sort of multi part message but I do not see any other methods calls that could be of use to get this.

 

 

Berobo Inc.
Police Scanner Radio / Alarm Clock lets you listen to Police scanners in your area!
http://www.berobo.com
_________________________________________________
Please click the Like button to thank the user that has helped you and
please mark post as solved when you have found the solution to your problem.
Please use plain text.
BlackBerry Development Advisor (Retired)
kizkasen
Posts: 54
Registered: ‎06-26-2012
My Device: BlackBerry Bold 9900

Re: Can't get incoming email message body.

Has the body been downloaded? Some aren't if they are from initial sync. 

Please use plain text.
Developer
BeroboInc
Posts: 123
Registered: ‎07-08-2011
My Device: Torch 9800, Bold 9700

Re: Can't get incoming email message body.

Thanks.

 

It was a plain text message being sent via gmail. If the subject and sender and other data regarding the email is there wouldn't the plain text body be there as well without requiring further downloading?

 

But in anycase, if it didn't download the entire email is there a way to confirm this and also force or wait for the remaining of the email to be downloaded?

 

I am using the messageAdded signal and trying to extract the data from the newly added message. I am not sure at the time that signal is sent whether the entire message has been downloaded. 

 

 

Berobo Inc.
Police Scanner Radio / Alarm Clock lets you listen to Police scanners in your area!
http://www.berobo.com
_________________________________________________
Please click the Like button to thank the user that has helped you and
please mark post as solved when you have found the solution to your problem.
Please use plain text.
Developer
BeroboInc
Posts: 123
Registered: ‎07-08-2011
My Device: Torch 9800, Bold 9700

Re: Can't get incoming email message body.

Am I the only one with this problem not being able to get the body of an email?

 

I've tried testing whether the email is still downloading. Doesn't seem to be the case. These are simple text emails. body() is not contain the email body.

 

Berobo Inc.
Police Scanner Radio / Alarm Clock lets you listen to Police scanners in your area!
http://www.berobo.com
_________________________________________________
Please click the Like button to thank the user that has helped you and
please mark post as solved when you have found the solution to your problem.
Please use plain text.
New Developer
paul0813
Posts: 7
Registered: ‎02-16-2009
My Device: Blackberry Z10

Re: Can't get incoming email message body.

Did you ever figure this out?  I'm having the same problem.

Please use plain text.
Developer
matizeitune
Posts: 366
Registered: ‎07-15-2013
My Device: blackberry Z10

Re: Can't get incoming email message body.

try with ["content:encoded"]

If you find this information useful please click like --->
@mezeitune on twitter
Please use plain text.
New Developer
paul0813
Posts: 7
Registered: ‎02-16-2009
My Device: Blackberry Z10

Re: Can't get incoming email message body.

Not sure what you mean by that.  I did solve the problem though.  When I get the messageAdded signal, I then call the MessageService::downloadBody() method and wait for the MessageService::bodyDownloaded() signal, at which point the body of the email is available. 

Please use plain text.