public class EmailListener implements OnClickListener{

 

@Override

public void onClick(DialogInterface dialog, int which) {

//新建一个E-mail 的Intent

Intent EmailIntent = new Intent(Intent.ACTION_SEND);

 

//设置E-mail标题

String subject = "关于 aLibro";

EmailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);

 

//设置Email的内容

String body = "关于 aLibro 的开发";

EmailIntent.putExtra(Intent.EXTRA_TEXT, body);

 

//设置要发送到的Email地址

String[] Email_to = new String[]{"to1@example.com","to2@example.com"};

EmailIntent.putExtra(Intent.EXTRA_EMAIL, Email_to);

 

//设置抄送的Email地址

String[] Email_cc = new String[]{"cc1@example.com","cc2@example.com"};

EmailIntent.putExtra(Intent.EXTRA_CC, Email_cc);

 

//设置密送的Email地址

String[] Email_bcc = new String[]{"bcc1@example.com","bcc2@example.com"};

EmailIntent.putExtra(Intent.EXTRA_BCC, Email_bcc);

 

//如果是一般的Email,应该是纯文字的形态

EmailIntent.setType("text/plain");

 

//让用户自行决定要传送的E-mail客户端

startActivity(Intent.createChooser(EmailIntent, "E-mail chooser"));

}

 

}

 

权限设置:

<uses-permission android:name="android.permission.SEND_SMS"/>

相关文章:

  • 2021-08-21
  • 2021-11-03
  • 2022-12-23
  • 2021-11-24
  • 2022-01-23
  • 2021-09-13
猜你喜欢
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
  • 2022-02-03
相关资源
相似解决方案