发送HTML电子邮件以意向意向、电子邮件、HTML

2023-09-08 00:01:48 作者:笑傲苍穹

我要当一个用户决定分享我的应用程序发送的HTML电子邮件。我为了使用HTML有一个定制的称谓消息。

I want to send a HTML e-mail when an user decides to share my app. I'm using HTML in order to have a customised and appellative message.

第一种方法,我尝试使用Html.fromHtml创建我的HTML(内嵌样式)的字符串,但是当我收到邮件是纯文本文件,不需要定制。

First approach, I tried to create a String with my HTML (inline style) using Html.fromHtml but when I received the e-mail it was pure txt, no customization.

第二条本办法,送一个附加的HTML文件。这种方法的问题是,HTML是不显示直到用户打开连接

Second approach, send a HTML file attached. The problem with this approach is that the HTML is not showed until the user opens the attach.

什么是最好的解决方案,这可能吗? 谢谢!

What's the best solution, is it possible? Thanks!

推荐答案

您可以使用此方法实现你的任务 Html.fromHtml(字符串);

You can achieve your task using this method Html.fromHtml(String);

Html.fromHtml("<font color='#ff123456'>text</font>")