Send Email Intent

前端 未结 30 3263
忘掉有多难
忘掉有多难 2020-11-22 07:27
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType(\"text/html\");
intent.putExtra(Intent.EXTRA_EMAIL, \"emailaddress@emailaddress.com\");
intent.putExtr         


        
30条回答
  •  囚心锁ツ
    2020-11-22 07:51

    If you want only the email clients you should use android.content.Intent.EXTRA_EMAIL with an array. Here goes an example:

    final Intent result = new Intent(android.content.Intent.ACTION_SEND);
    result.setType("plain/text");
    result.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { recipient });
    result.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
    result.putExtra(android.content.Intent.EXTRA_TEXT, body);
    

提交回复
热议问题