Send HTML email with Gmail 4.2.1

前端 未结 4 1561
眼角桃花
眼角桃花 2020-12-14 01:35

It seems that Gmail 4.2.1 may have broken HTML-formatted emails. The following code worked perfectly prior to 4.2.1. The email that was sent from Gmail had the desired emb

4条回答
  •  佛祖请我去吃肉
    2020-12-14 02:30

    private void sendMail(String appName, String playStoreLink) {
        String msg = "Hello,
    Recently,I downloaded "+appName+""+ " from Play Store.I found this very challenging and a great game."+ "
    I would like to suggest you this game.

    Download

    "+ "
    Thank You"; String sub = "Get it now. It is there in Play Store"; Intent email = new Intent(Intent.ACTION_SEND); email.setType("text/html"); email.putExtra(Intent.EXTRA_SUBJECT, sub); email.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(msg)); email.setType("message/rfc822"); startActivity(Intent.createChooser(email, "Choose an Email client :")); }

提交回复
热议问题