0

私は現在Androidプロジェクトに取り組んでおり、メールを送信できるように設定を追加しています。私はACTION_SENDTOメールを送信するためにインテントを使用していますが、メールが戻ってきて、と言いNo apps can perform this actionます。

以下は私が使用しているコードです

Intent intent = new Intent(Intent.ACTION_SENDTO);
                intent.setType("text/plain");
                intent.putExtra(Intent.EXTRA_EMAIL, "someone@example.com");
                intent.putExtra(Intent.EXTRA_SUBJECT, "Check out this android app");
                intent.putExtra(Intent.EXTRA_TEXT, "Check out this new app in the Google Play Store. Its from Boardies IT Solutions and is called Boardies Password Manager. You can find it at https://play.google.com/store/apps/details?id=com.BoardiesITSolutions.PasswordManager");
                startActivity(Intent.createChooser(intent, "Send Email"));

あなたが提供できるどんな助けにも感謝します

4

2 に答える 2

1

以下を追加する必要があります

intent.setData(Uri.parse( "mailto:" + "email@bla.com")); //特異性がない場合は空白のままにします

于 2012-12-20T01:30:51.390 に答える
0

私はあなたがに置き換える必要があると思います、これがあなたのために働くことIntent.ACTION_SENDTOを 願っています。Intent.ACTION_SEND

このコードはどうですか:

final Intent emailLauncher = new Intent(Intent.ACTION_SEND);
emailLauncher.setType("message/rfc822");
emailLauncher.putExtra(Intent.EXTRA_EMAIL, "username@domain.com");
emailLauncher.putExtra(Intent.EXTRA_SUBJECT, "check this subject line");
emailLauncher.putExtra(Intent.EXTRA_TEXT, "hey check this message body!");
try{
       startActivity(emailLauncher);
}catch(ActivityNotFoundException e){

}
于 2014-06-10T07:20:01.653 に答える