react-native-mail icon indicating copy to clipboard operation
react-native-mail copied to clipboard

Android Limited HTML Email?

Open dereksweet opened this issue 8 years ago • 7 comments

I seem to be having a problem getting a good HTML email sent out by android. It looks great on iOS, but it seems on Android that only the br tags are respected, all other text formatting and inline CSS styling is ignored.

Using a GMail account on both iOS and Android for delivery.

dereksweet avatar Sep 04 '17 01:09 dereksweet

I am having the same issue. Have you found a work-around?

stnmonroe avatar Jan 18 '18 02:01 stnmonroe

No I don't believe I ever did, actually. I just made the plain text version look as nice as I could :(

dereksweet avatar Jan 18 '18 02:01 dereksweet

For the record, the issue is still there, I could not get anything except a br be rendered as html on android mail client's email body

bhave-abhay avatar Feb 21 '19 14:02 bhave-abhay

I think this is source of why html doesn't work on android. According to the mailto RFC only plain-text is supported. Unless android supports another way to communicate with mail clients other than mailto, i'm not too sure if it's even possible. I don't have much experience writing native android apps but i am very comfortable with java. I'm going to see if i can find an approach other than using mailto that allows passing along html that then gets rendered. I'll post my findings here

HTML support for iphone only works because the underlying native module is leveraging MFMailComposeViewController which itself directly supports the use of HTML. Source here. It's worth noting that this only works for the native mail app. Support for other mail apps (i.e. gmail) is dependent on whether the URL Scheme for that app is willing to accept html and render it

mistermoe avatar Sep 22 '19 09:09 mistermoe

Hello, I can see that this issue is still open. Is there a fix for this?

Thanks.

lattrellsapon avatar Jan 06 '21 08:01 lattrellsapon

It's not fixed. I think that Intent should use EXTRA_HTML_TEXT together with EXTRA_TEXT. Now it uses only second one so basically it has the same result regardless of isHtml value.

gsieczkowski10clouds avatar Jun 17 '21 15:06 gsieczkowski10clouds

I am having the same issue. Have you found a work-around? Maybe it doesn't work in Android

pinefirst avatar Feb 18 '23 16:02 pinefirst