我开发了一个应用程序,可以捕获图像并将信息叠加层添加到图像上。企业希望通过电子邮件发送图像。我在一家公司工作,他们希望通过安全方式发送电子邮件的设备上的MaaS360设备管理客户端来发送电子邮件。

我已经成功实现了代码以发送带有图像的电子邮件。这是代码:

Intent i = new Intent(Intent.ACTION_SEND);
i.setType("S/MIME");
i.putExtra(Intent.EXTRA_EMAIL  , new String[]{"aaron.rogers@almacgroup.com"});
i.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
i.putExtra(Intent.EXTRA_TEXT   , "body of email");
fileLoc = file.getAbsolutePath();
SharedPreferences info = this.getSharedPreferences("info", MODE_PRIVATE);
info.edit().putString("info", fileLoc).commit();
File file = new File(fileLoc);
if (!file.exists() || !file.canRead()) {
Toast.makeText(this, "Attachment Error", Toast.LENGTH_LONG).show();
finish();
return;
}
Uri uri = Uri.fromFile(file);
i.putExtra(Intent.EXTRA_STREAM, uri);
try {
startActivity(Intent.createChooser(i, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(Camera1.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}


在发送电子邮件时,设备会根据我们设置的MIME类型提示使用哪个应用程序发送电子邮件。我尝试了多种mime类型,但是Maas360客户端从未显示在选项列表中。

有谁知道我如何让它显示在列表中?

感谢帮助!

最佳答案

Maas360不像GMAIL这样的电子邮件客户端那样支持附件的自动填充。

07-28 03:53
查看更多