Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML markup is stripped in Android's default email app #53

Closed
JwJason opened this issue Jul 18, 2014 · 13 comments
Closed

HTML markup is stripped in Android's default email app #53

JwJason opened this issue Jul 18, 2014 · 13 comments

Comments

@JwJason
Copy link

JwJason commented Jul 18, 2014

HTML markup (not just CSS) is stripped out of the message body in Android's default email app.

        window.plugin.email.open({
                        subject:    'Test',
                        body:       '<h1>Test</h1><a href="http://google.com'">Test</a>',
                        isHtml:     true,
                    }, emailCallback);

Tried sending the message to my gmail address. Received a plain text email with no hyperlink or formatting:

 Test
 Test

Tested on Android emulator platform 4.4.2 API level 19.

@AtanuCSE
Copy link

'<h1>Test</h1><a href="http://google.com'">Test</a>'

your code is wrong. A extra ' just after the google.com

@JwJason
Copy link
Author

JwJason commented Jul 21, 2014

Still doesn't work with the fixed code.

@u2ill
Copy link

u2ill commented Jul 24, 2014

@JwJason,

I noticed you also have an extra comma after isHtml: true

Since that is the last parameter in the options object, you should not have a comma after it!

The following should work:

    window.plugin.email.open({
                    subject:    'Test',
                    body:       '<h1>Test</h1><a href="http://google.com">Test</a>',
                    isHtml:     true
                }, emailCallback);

@JwJason
Copy link
Author

JwJason commented Jul 25, 2014

That is valid JS syntax. Have you tried reproducing the error on android emulator 4.4.2 API level 19?

@craigcampbell
Copy link

We are also having the same issue with it not working. If we simply do a H1 it comes across bold but any inline styling does not work.

@mirko77
Copy link

mirko77 commented Aug 14, 2014

Trailing "," is not valid in "strict mode"

@hiniesta
Copy link

Have same error, in this case, the

tags. All tr and td tags are removed.

@cgs
Copy link

cgs commented Oct 3, 2014

+1, also not working for me. HTML formatted email looks fine in iOS, not working in Android.

@bbisinger
Copy link

I am also experiencing the same problem with Android. Oddly, some inline css does work.. for example "margin-top:20px" works perfectly. "font-weight:bold" does not.Like hiniesta, all of my tr and td tags are being stripped out. I effectively cannot format my emails

@katzer
Copy link
Owner

katzer commented Oct 9, 2014

@katzer katzer closed this as completed Oct 9, 2014
@bbisinger
Copy link

Thanks for the update and updating the docs. I would include the note that inline CSS also does not work... this might save you from additional questions :-p

@cgs
Copy link

cgs commented Oct 17, 2014

I'm still having an issue with this, and I'm not sure if it's just me, or something not related to the plugin. I'm only using tags from the link referenced above (https://github.com/katzer/cordova-plugin-email-composer#html-and-css-on-android). My email looks formatted in the default Android client as well as Gmail. When I actually send the email, the formatting and any links get stripped. Any idea why?

@bbisinger
Copy link

I'm not sure why that is, but it turns out that we can't have html content in our gmail/android emails. Th fact that you see it initially seems like something else entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants