How to code using android studio to send an email

前端 未结 3 991
渐次进展
渐次进展 2021-02-04 07:23

I\'m planning to develop an android mobile application using android studio, where an user give email address and secret code. Then that secret code should be send to mentioned

3条回答
  •  天涯浪人
    2021-02-04 07:39

    If you use Intent.ACTION_SEND android show all communicatons app. If you want show only email client you can use the following code.

     Intent mailIntent = new Intent(Intent.ACTION_VIEW);
     Uri data = Uri.parse("mailto:?subject=" + "subject text"+ "&body=" + "body text " + "&to=" + "destination@mail.com");
     mailIntent.setData(data);
     startActivity(Intent.createChooser(mailIntent, "Send mail..."));
    

提交回复
热议问题