android BCC不适用于电子邮件

时间:2014-01-07 05:12:45

标签: android

emailIntent.putExtra(android.content.Intent.EXTRA_BCC,
               new String[] {"postcards@in-touchmobile.com"});

我已尝试使用此代码,但bcc无法包含在我的gmail应用程序中。

我的完整代码是

Intent emailIntent = new Intent(
                            android.content.Intent.ACTION_SEND_MULTIPLE);
                    emailIntent.setType("text/plain");
                    emailIntent.putExtra(
                            Intent.EXTRA_EMAIL,
                            new String[] { Constants.EMAIL });
                    emailIntent.putExtra(
                            android.content.Intent.EXTRA_TEXT,
                            Html.fromHtml(str));
                    emailIntent.putExtra(
                            android.content.Intent.EXTRA_BCC,
                            new String[] { "postcards@in-touchmobile.com" });
                    emailIntent.putExtra(
                            android.content.Intent.EXTRA_SUBJECT,
                            Constants.Subject);

                    ArrayList<Uri> uris = new ArrayList<Uri>();
                    uris.add(screenshotUri);
                    emailIntent.putParcelableArrayListExtra(
                            Intent.EXTRA_STREAM,
                            uris);
                    startActivity(emailIntent);
                    startActivity(emailIntent);

我已经像上面那样更改了我的代码..但仍然没有工作..

2 个答案:

答案 0 :(得分:0)

Intent的类型从image/pngapplication/octet-stream更改为plain/text,如

  emainIntent.setType("plain/text");

并将文件附加到电子邮件,请参阅here

答案 1 :(得分:0)

以这种方式尝试

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); 
emailIntent.setType("application/image");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{strEmail}); 
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,"Test Subject"); 
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "From My App"); 
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///mnt/sdcard/Myimage.jpeg"));
startActivity(Intent.createChooser(emailIntent, "Send mail..."));

必须做这件事emailIntent.setType("application/image");

检查并告诉我