直接贴代码:

 

Intent intent = new Intent(android.content.Intent.ACTION_SEND);// 附件File file = new File(Environment.getExternalStorageDirectory().getPath()+ File.separator + "simplenote"+ File.separator+"note.xml");// 收件人intent.putExtra(android.content.Intent.EXTRA_EMAIL,new String[] {"pop1030123@163.com"});// 主题intent.putExtra(android.content.Intent.EXTRA_SUBJECT, "note.xml");// 正文intent.putExtra(android.content.Intent.EXTRA_TEXT,"this is test extra.");intent.setType("application/octet-stream");//当无法确认发送类型的时候使用如下语句//intent.setType(“*/*”);//当没有附件,纯文本发送时使用如下语句//intent.setType(“plain/text”);intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));NoteActivity.mNext_tab = NoteActivity.NOTE_SETTING;startActivity(Intent.createChooser(intent, "Mail Chooser"));

 

 

另外的参考代码:

 

//系统邮件系统的动作为android.content.Intent.ACTION_SENDIntent email = new Intent(android.content.Intent.ACTION_SEND);email.setType("text/plain");emailReciver = new String[]{"pop1030123@163.com", "fulon@163.com"};emailSubject = "你有一条短信";emailBody = sb.toString();//设置邮件默认地址email.putExtra(android.content.Intent.EXTRA_EMAIL, emailReciver);//设置邮件默认标题email.putExtra(android.content.Intent.EXTRA_SUBJECT, emailSubject);//设置要默认发送的内容email.putExtra(android.content.Intent.EXTRA_TEXT, emailBody);//调用系统的邮件系统startActivity(Intent.createChooser(email, "请选择邮件发送软件"));

更多相关文章

  1. Android开发EditText属性
  2. ViewPager
  3. android 用代码编写linearlayout布局
  4. Android(安卓)系统自带的发送短信的界面源码
  5. 编写android拨打电话apk应用实例代码
  6. 动态设置android:drawableLeft|Right|Top|Bottom
  7. 修改android默认语言选项
  8. android背景与style的设置
  9. 【Android】Android(安卓)权限大全

随机推荐

  1. 世界顶级公司的前端面试都问些什么[每日
  2. 精通webpack的5大关键点
  3. 使用机器学习生成可维护的前端代码(附源
  4. 前端AI实战——告诉世界前端也能做AI
  5. 文末重磅福利|Python实现回归预测及模型优
  6. 使用 RAIL 模型评估前端性能 [每日前端夜
  7. RPA 2020.11 all in one 安装
  8. Django-bootstrap3|在Django中快速使用Boo
  9. 高中学历的前端又如何?照样可以年薪30万!
  10. 【工具】历史文章分类汇总-V6 | Python数