Email dialog HTML ignores some tags Titanium Mobli

2019-08-22 01:57发布

问题:

I'm currently building an app that has Email sending capabilities. I'm trying to send an Email with the relevant information and includes a link to the original post that is being sent. the original post is created as an HTML code segment, so I have to send the Email as an HTML. i create the Email dialog like this:

var mail = Ti.UI.createEmailDialog({
    subject:'FW:'+post.desc,
    html:true,
    messageBody: '<br><br><a href="http://www.XXXXXXXX.com/index.php?tid='+post.id+'" target="_blank">view original post</a><br><br><b style="font-size:1.5em;font-family:Arial">'+post.desc+'</b><br><br><i>'+metaData.text.toString().replace(/\n/g,'<br>')+' </i><br><br>'+post.htmlData
});
Ti.API.debug(mail.messageBody)
mail.open();

when I ran the app on my device, I got the option of sending via "mail" or via "Gmail". when sent via "mail", all the link tabs and and were ignored and striped so the Email didn't include them. however, the "Gmail" option left everything as suppose to. any thoughts?

the question was asked also in Titanium Q&A

回答1:

Apparently, the default Email client for Android doesn't have a HTML renderer and disregards it, and the Gmail Android client won't parse certain tags like . it seems to me like the answer will be using temporary files and attachments. if anybody comes up with a better answer I'll be very happy.

happy X-mas | Hanukah | festivus for the rest of us