08-30-2010 01:23 PM
I'm not sure if what I'm trying to do is possible, but I figured this would be a good spot for help. Here's what I'm trying to do:
-App receives push message
-App goes to server to retrieve some extended data regarding the message
-App then creates a Message object, and places it in the users Inbox with data received from push/server
I have all three steps working, however my next step is to embed an image into this Message that is in the user's inbox. Is this possible? So far, I've been able to include the image as an attachment, but I'd like the image to automatically display as if it were embedded in an HTML email.
Any help is appreciated.
08-30-2010 02:28 PM
How would I display HTML in the message? I've tried doing something like:
but it just displays all the HTML as text in the message body. Any examples are appreciated.
08-30-2010 02:45 PM
Sorry, maybe I wasn't clear. My device already has HTML e-mails enabled - I receive them all the time. However, if I create a Message in the Java code, the HTML code ends up displaying as text rather than formatted HTML.
So my code would be something like:
Message message = new Message(mInboxFolder); message.setFrom(new Address("1234", "Address Here")); message.setSubject("Push Alert"); message.setContent("<html><body><a href=\"test.html\">TEST LINK</a></body></html>"); message.setInbound(true); message.setStatus(Message.Status.RX_RECEIVED, Message.Status.TX_DELIVERED); mInboxFolder.appendMessage(message);
Now when I open the message that was placed in my Inbox on my device, the body is literally just the HTML code verbatim:
<html><body><a href=\"test.html\">TEST LINK</a></body></html>
So, if my device already has HTML messages enabled, how can I create an HTML message that will display properly via Java code?
08-30-2010 02:56 PM
(Those constants are defined in interface HttpProtocolConstants.)
08-31-2010 08:26 AM
Does anyone know how to embed HTML into a Message that will be placed into a user's inbox? So far, I can only get the HTML code to display as the actual message body.