【问题标题】:How to send Html Table in Email in android Application如何在 Android 应用程序的电子邮件中发送 Html 表
【发布时间】:2014-03-28 06:29:55
【问题描述】:

我正在通过 Gmail 发送一封电子邮件。我在 rows 和 Collunms 中有数据。我想通过 Gmail 在电子邮件中发送 HTML 表格。

                mailBody+="\n<!DOCTYPE html> \n<html>\n<body>\n<table border="+1+" style="+"width:300px"+">\n<tr>\n<td>arslan</td>\n<td>arslan</td>\n<td>asad</td>\n<td>50</td>\n</tr>\n</table>\n</body>\n</html>";

我已通过电子邮件发送邮件正文,但没有成功。我需要接收者在电子邮件中获得表格。

【问题讨论】:

    标签: android email html-email


    【解决方案1】:

    试试下面的代码:

    final Intent shareIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:"));
    shareIntent.putExtra(Intent.EXTRA_SUBJECT, "The Subject");
    shareIntent.putExtra(
    Intent.EXTRA_TEXT,
    Html.fromHtml(new StringBuilder()
        .append("<p><b>Some Content</b></p>")
        .append("<small><p>More content</p></small>")
        .toString())
    );
    

    更多链接见

    android - How to format the text as table in email body of email client

    How to send HTML email

    还要检查这是否适用于 Android 4.0 及更高版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-24
      • 2011-08-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-12
      相关资源
      最近更新 更多