【问题标题】:Android sending email with css html embeddedAndroid发送嵌入css html的电子邮件
【发布时间】:2012-11-18 15:08:06
【问题描述】:

我正在使用来自 android 应用程序的意图发送邮件,但我的 css 没有加载。有人可以帮我加载css吗?我哪里错了。几个小时以来,我一直坚持这个愚蠢的选择。

这里是我的 div 的一部分。

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

【问题讨论】:

    标签: android android-intent


    【解决方案1】:

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

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

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

    编辑: 这是我如何做到的示例:

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

      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:")); 
      

    【讨论】:

      猜你喜欢
      • 2010-11-12
      • 2014-09-23
      • 1970-01-01
      • 2016-12-07
      • 2011-03-30
      • 2017-01-16
      • 1970-01-01
      • 1970-01-01
      • 2016-08-23
      相关资源
      最近更新 更多