android调用邮件应用发送email
直接贴代码:
- 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_SEND
- Intent 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, "请选择邮件发送软件"));
android调用邮件应用发送email的更多相关文章
- 廖雪峰Java13网络编程-2Email编程-1发送email
1.邮件发送 1.1传统邮件发送: 传统的邮件是通过邮局投递,从一个邮局到另一个邮局,最终到达用户的邮箱. 1.2电子邮件发送: 与传统邮件类似,它是从用户电脑的邮件软件(如outlook)发送到邮件 ...
- android中调用系统的发送短信、发送邮件、打电话功能
1 调用发送短信功能: Uri smsToUri = Uri.parse("smsto:"); Intent sendIntent = new Intent(Intent.ACT ...
- python 发送email邮件带附件
EMAIL功能实现: 1.发送EMAIL带附件,并且带压缩文件夹做为附件 #_*_coding:utf-8_*_ import smtplib from email.mime.text import ...
- C#发送Email邮件(实例:QQ邮箱和Gmail邮箱)
下面用到的邮件账号和密码都不是真实的,需要测试就换成自己的邮件账号. 需要引用: using System.Net.Mail; using System.Text; using System.Net; ...
- [转]C#发送Email邮件 (实例:QQ邮箱和Gmail邮箱)
下面用到的邮件账号和密码都不是真实的,需要测试就换成自己的邮件账号. 需要引用:using System.Net.Mail;using System.Text;using System.Net; 程序 ...
- 使用spring 并加载模板发送Email 发邮件 java 模板
以下例子是使用spring发送email,然后加载到固定的模板,挺好的,大家可以试试 需要使用到spring-context 包 和 com.springsource.org.apache.veloc ...
- 【转】C#发送Email邮件
转自:http://hi.baidu.com/bluesky_cn/item/8bb060ace834c53f020a4df2 下面用到的邮件账号和密码都不是真实的,需要测试就换成自己的邮件账号. 需 ...
- .net 邮件批量发送功能源码
#define debug using System; using System.Text; using System.Linq; using System.IO; using System.Ne ...
- asp.net发送E-mail
发送电子邮件也是项目开发当中经常用到的功能,这里我整理了一个发送电子邮件(带附件,支持多用户发送,主送.抄送)的类库,供大家参考. 先上两个实体类,用于封装成Mail对象. /// <summa ...
随机推荐
- nuxt 头部引入js文件 第一次进入页面不加载js文件的解决方法
head () { return { title: '', meta: [ { hid: 'description', name: 'description', content: '' } ], sc ...
- Java poi 的使用
poi可操作老旧版本的excel 下载jar包,http://archive.apache.org/dist/poi/release/bin/poi-bin-3.17-20170915.tar.gz ...
- robotframework接口测试实例
*** Settings *** Library Collections Library RequestsLibrary *** Test Cases *** test Create Session ...
- QT +自定义控件-spin+slider
动手实现自定义控件: 1.首先在ui界面中添加一个(Widget)容器类.如图中的1所示 2.在项目中添加一个SmallWidget类,如下: 3.接着在程序编辑界面进行程序编辑如下: #includ ...
- gitlab autuo devops
[参考文章] Chengzi_comm的专栏 use gitlab ci docker run gitlab-runner gitlab-runner register 1. 在虚拟机或服务器运行gi ...
- PWN题搭建
0x00.准备题目 例如:level.c #include <stdio.h> #include <unistd.h> int main(){ char buffer[0x10 ...
- Ibatis入门基本语法
1. Ibatis是开源软件组织Apache推出的一种轻量级的对象关系映射(ORM)框架,和Hibernate.Toplink等在java编程的对象持久化方面深受开发人员欢迎. 对象关系映 ...
- mysqldump导出备份数据库报Table ‘performance_schema.session_variables‘ doesn‘t exist
今天在bash进行本地数据库往云端数据库导数据的时候,在本地导出.sql文件这第一步就出现了错误问题,导出sql文件的命令: mysqldump -u 用户名 -p 数据库名 > xxx.sql ...
- axure笔记--内置变量
部件变量: This:当前变量名称 Target:目标变量的名称 x,y表示组件左上角的位置 name:获取当前组件标签命名 Top:获取组件上边界到x轴的距离 bottom:获取组件下边界到x轴的距 ...
- Python Cookbook3 Python进阶教程 http://python3-cookbook.readthedocs.io/zh_CN/latest/copyright.html
http://python3-cookbook.readthedocs.io/zh_CN/latest/copyright.html