Android发送嵌入了css html的电子邮件 [英] Android sending email with css html embedded

查看:82
本文介绍了Android发送嵌入了css html的电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从Android应用程序使用意图发送邮件,但我的CSS没有加载.有人可以帮我加载CSS吗.我在哪里错.现在,这个愚蠢的选择被困了几个小时.

I am sending a mail using intent from android application but my css is not loading. can someone help me load the css please. where am i wrong. Am stuck on this silly option for hours nows.

这是我的部门的一部分.

here part of my div.

<div style="background:"+String.format(hex,colors.get(position).hex)"></div> ...

推荐答案

我遇到了同样的问题,无法解决. 我认为无法使用默认的电子邮件客户端发送CSS(如果我输入错了,请纠正我).

I had the same problem, and couldnt fix it. I don't think its possible to send css with the default email clients (correct me if i'm wrong).

我的解决方法是将html作为附件发送.

My work around was sending the html as a attachment.

请参阅: 是否可以使用邮件意图发送html?/a>

see: Is it possible to send html with the mail intent?

这是我的操作方法示例:

here is example how i did it:

  • 将html保存为文件.
  • 将附件添加到Uri对象列表中
  • 请参阅以下代码,如何使用附件创建邮件意图.

  • save the html as a file..
  • add you attachments to a list of Uri objects
  • see following code how to create a mail intent with the attachements..

final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE);
    emailIntent.setType("text/html");
    emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "title");

    emailIntent.putExtra(Intent.EXTRA_TEXT, "email body text");
    emailIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
    startActivity(Intent.createChooser(emailIntent, "Email:")); 

这篇关于Android发送嵌入了css html的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆