Mike
Mike

Reputation: 3575

GAE: Incoming emails can not preserve format

I've set up my GAE/Java project to receiving emails and it works pretty fine excepting it can not preserve the incoming mail's format(e.g. bold, italic, font size, text color, bulleted list...), and the content type of incoming mails are always "text/plain", as a result from the end user's view the mail content huddled and unreadable.

For example I send a formatted mail from Gmail, when I receiving the mail in GAE all formats is tripped off and leaves a bulk of plain text.

Is there any way I can get incoming mail type as HTML so the format would be preserved?

Upvotes: 0

Views: 100

Answers (2)

Vishal Biyani
Vishal Biyani

Reputation: 4407

Looks like a duplicate of this question and answer

Moreover, I am copying a few excerpts from Google App Engine Documentation here which says:

The message contains a subject, a plaintext body, and an optional HTML body. 
It can also contain file attachments, as well as a limited set of headers.

And I am guessing the content type should be text/html

Upvotes: 0

Niks Jain
Niks Jain

Reputation: 1647

While sending the mail through server. Set the body content type text/html.

    .
    .
    .
    htmlPart = new MimeBodyPart();
    htmlPart.setContent("<b>html content</b>", "text/html");

This should work for you..

Upvotes: 1

Related Questions