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
New Developer
bvanburen
Posts: 3
Registered: ‎08-24-2009
My Device: Not Specified

Sending email with html using java api

[ Edited ]

Hello.

Does anybody know how to add HTML to an email using the java api. 

 

I am tried something like this but its not working.

 

String content = "Content-Type: text/html; charset=\"iso-8859-1\"\n" +

"Content-Transfer-Encoding: 7bit\n\n" +

"<html><body><table>" ;

.......

content += "</table></body></html>";

 

 

Multipart mp =
new Multipart();

 

BodyPart mbp =
new MimeBodyPart(mp);

//bp.setContentType();

mbp.setContentType(ContentType.TYPE_MULTIPART_ALTERNATIVE_STRING);

mbp.setContent(content);

m.setContent(mp);

 

 

Thanks!!

Message Edited by bvanburen on 09-15-2009 06:51 AM
Please use plain text.
Developer
Nidhi
Posts: 31
Registered: ‎10-09-2009
My Device: Not Specified

Re: Sending email with html using java api

HI,

 

I also want to know , how to add html to an email using blackberry mail api.

 

Please let me know if one has any information about the same.

 

Thanks in advance

 

 

Please use plain text.
Visitor
mikka
Posts: 1
Registered: ‎05-26-2010
My Device: BOLD 9000
My Carrier: MTS

Re: Sending email with html using java api

Blackberry can receive and display HTML mail, but not send.

Please use plain text.
Developer
sblantipodi
Posts: 1,178
Registered: ‎02-19-2009
My Device: Not Specified

Re: Sending email with html using java api

Hi,

I'm trying to send HTML email using BB API,

are you sure that is not possible to send HTML mail?

Please use plain text.
Developer
sblantipodi
Posts: 1,178
Registered: ‎02-19-2009
My Device: Not Specified

Re: Sending email with html using java api

if I create a message

 

 Message email = new Message();

 

I can call email.setHeader()

 

no one had luck sending HTML email in this way?

Please use plain text.
Developer
sblantipodi
Posts: 1,178
Registered: ‎02-19-2009
My Device: Not Specified

Re: Sending email with html using java api

I'm searching for a solution here but the only one that I have in mind actually

is to attach an HTML file, unfortunantly I don't like this solution. -_-

Please use plain text.
Developer
sblantipodi
Posts: 1,178
Registered: ‎02-19-2009
My Device: Not Specified

Re: Sending email with html using java api

sending HTML as attachments seems to be good for a PC viewing but not really good

for blackberry viewing.


Blackberry isn't really good when rendering HTML attachment,

don't understand why since if I send the same HTML code in a HTML mail format it renders well...

Please use plain text.
Regular Contributor
mohdfarhanakram
Posts: 73
Registered: ‎12-30-2011
My Device: All devices
My Carrier: RIM

Re: Sending email with html using java api

Hi Everone,

 

   Please post solution of this thread its urgent for me.

Thanks

Mohd Farhan
Please use plain text.