发送电​​子邮件随着Android的唯一的电子邮件客户端应用程序 [英] Send Email With only Email client application in android

查看:177
本文介绍了发送电​​子邮件随着Android的唯一的电子邮件客户端应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现一个选项,以发送电子邮件。现在我可以发送电子邮件,但问题是,Android的显示许多应用程序发送诸如不需要蓝牙,Facebook,邮件等。我要避免这种情况,仅显示电子邮件客户端应用程序。

 意向意图=新意图(Intent.ACTION_SEND);
的String [] =电子邮件{suresh.chandani@gmail.com};
intent.putExtra(Intent.EXTRA_EMAIL,电子邮件);
intent.putExtra(Intent.EXTRA_STREAM,URI);
intent.putExtra(Intent.EXTRA_SUBJECT,测试应用程序);
intent.putExtra(Intent.EXTRA_TEXT,电子邮件正文);
intent.setType(信息/ RFC822);
startActivity(意向);

如果任何人知道如何做到这一点请让我知道


解决方案

 意向意图=新意图(Intent.ACTION_SENDTO,Uri.parse(电子邮件地址:suresh.chandani@gmail.com );
intent.putExtra(Intent.EXTRA_SUBJECT,测试应用程序);
intent.putExtra(Intent.EXTRA_TEXT,电子邮件正文);
startActivity(意向);

幸得亚当斯兄弟博客,但他确实在他的文章提到,这只是工作的Gmail他。看看你是否有任何与它的成功。他确实表明这样做是为他工作的另一种方式。

I want to implement an option to send email. Right now i can send email but problem is, Android shows many applications to send such as bluetooth, facebook, message,etc which is not required. I need to avoid this and show only email client application.

Intent intent = new Intent(Intent.ACTION_SEND); 
String[] emails = {"suresh.chandani@gmail.com"}; 
intent.putExtra(Intent.EXTRA_EMAIL, emails); 
intent.putExtra(Intent.EXTRA_STREAM, uri); 
intent.putExtra(Intent.EXTRA_SUBJECT, "Test App"); 
intent.putExtra(Intent.EXTRA_TEXT, "Email Body"); 
intent.setType("message/rfc822"); 
startActivity(intent);

If any one knows to how to achieve this please let me know

解决方案

Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:suresh.chandani@gmail.com);    
intent.putExtra(Intent.EXTRA_SUBJECT, "Test App");  
intent.putExtra(Intent.EXTRA_TEXT, "Email Body");
startActivity(intent);

Credit goes to Adams Bros Blogs but he does mention in his post that this only worked for gmail for him. See if you have any success with it. He does show another way of doing this that worked for him.

这篇关于发送电​​子邮件随着Android的唯一的电子邮件客户端应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆