Android的电子邮件发送的验证 [英] Android e-mail sending verification

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

问题描述

我用下面的code发送电子邮件至可电邮地址。当我点击发送按钮,有一个敬酒味精说短信发送...,但是我没有它在code。它必须是默认的。我的问题是,这是说,消息发送,但并没有说明它被送到什么。我知道,如果它到了它不能被选中,但应该有一个味精说它的发送。我希望它显示了一个错误,当它不发送,但用户并不知道这一点。

I use the code below to send an e-mail to may e-mail address. When i click the send button, there's a toast msg saying Message send..., however i don't have it in the code. It must be default. My problem is that this is saying that the message is to be sent but does not say anything about that it was sent. I know it cannot be checked if it arrived, but there should be a msg saying it' s sent. I hope it shows an error when it is not sent, but the users do not know this.

Intent i = new Intent(Intent.ACTION_SEND);
        i.setType("text/plain");
        i.putExtra(Intent.EXTRA_EMAIL  , new String[]{"something@gmail.com"});
        i.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
        i.putExtra(Intent.EXTRA_TEXT   , "body of email");
        try {
           startActivity(Intent.createChooser(i, "Send mail..."));
        } catch (android.content.ActivityNotFoundException ex) {
           Toast.makeText(About.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
        }

感谢

推荐答案

这不能做。由于任何应用程序都可以给意图做出回应,没有任何结果,code的担保或导致意图。

This cannot be done. Since any application can respond to the Intent there is no guarantee of any result code or result intent.

请参阅:

<一个href=\"http://stackoverflow.com/questions/3600149/get-mail-sent-notification-in-onactivityresult-android\">Get邮件中的onActivityResult&QUOT发送的通知; Android和QUOT;

请参阅:

<一个href=\"http://stackoverflow.com/questions/5471217/trivial-get-confirmation-of-email-sent-in-android\">Trivial:收到电子邮件确认android系统中发送

在ICS我个人的测试同时显示电子邮件客户端的结果code返回0,而不管用户是否presses回或发送。

My own personal tests on ICS are showing both email clients returning 0 for the resultCode regardless of whether the user presses back or send.

这篇关于Android的电子邮件发送的验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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