使用ShareCompat.IntentBuilder将HTML内容发送到电子邮件客户端(Gmail)

时间:2019-01-25 13:20:28

标签: android kotlin

我正在尝试发送HTML格式的电子邮件。我一直在尝试下面的代码,但是没有运气

    val body = "<!DOCTYPE html><html><body><a href=\"http://www.w3schools.com\" target=\"_blank\">Visit W3Schools.com!</a></body></html>"

    ShareCompat.IntentBuilder.from(this)
            //.setType("message/rfc822")
            .setType("text/html")
            .setSubject("test")
            .setHtmlText(body) 
            .setChooserTitle("Send Email")
            .startChooser()

它只是不起作用...以纯文本格式出现。

0 个答案:

没有答案