【问题标题】:How to send a multipart email with both plain text and HTML in Android?如何在 Android 中发送包含纯文本和 HTML 的多部分电子邮件?
【发布时间】:2011-12-29 08:32:23
【问题描述】:

我正在尝试找出在 Android 中通过 Intent 发送多部分电子邮件的最简洁方式。电子邮件应该包含纯文本部分和 HTML 部分。

谢谢。

【问题讨论】:

    标签: android email android-intent html-email multipart


    【解决方案1】:
    String mailBody="Hello. I think you’d really enjoy this:"+
                    "<a href='www.google.com/'> Search eEngine  </a>"+
                    "from  Books"+"<br/><br/>"; 
    
    
    
    
                    Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); 
                    emailIntent.setType("text/html"); 
                    emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Search eEngine "); 
                    emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,Html.fromHtml(mailBody));                         
                    startActivity(Intent.createChooser(emailIntent, "Send mail..."));   
    

    【讨论】:

    • 这不是多部分电子邮件...这只是一封 HTML 电子邮件。
    • 我想使用 Android 发送一封多部分电子邮件(包含纯文本部分和 HTML 部分)。
    猜你喜欢
    • 2013-05-20
    • 2012-10-31
    • 1970-01-01
    • 2011-02-26
    • 2011-04-11
    • 2016-08-23
    • 2011-05-20
    • 2011-09-24
    相关资源
    最近更新 更多