的图像存储在Android的SD卡发送电子邮件与安卓(解决方案)附图片
我得到了解决,我们需要指定
<uses-permission android:name="android.permission.SEND_SMS"/>
清单中
和工作代码为:
String _path = Environment.getExternalStorageDirectory() + "/mapp/test.jpeg";
File file = new File(_path);
Uri outputFileUri = Uri.fromFile(file);
if(file.exists())
{
//final ConnectivityManager connMgr = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
//final int result = connMgr.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,Phone.FEATURE_ENABLE_MMS);
Toast.makeText(context,"exists",Toast.LENGTH_LONG).show();
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setType("image/jpeg");
sendIntent.putExtra(Intent.EXTRA_EMAIL, new String[] {"[email protected]"});
sendIntent.putExtra(Intent.EXTRA_SUBJECT,"World Toyata(via Android App");
sendIntent.putExtra(Intent.EXTRA_STREAM,outputFileUri);
sendIntent.putExtra(Intent.EXTRA_TEXT,"Problem Area Image");
startActivity(Intent.createChooser(sendIntent, ""));
}
else
{
Toast.makeText(context,"SD CARD Required ",Toast.LENGTH_LONG).show();
}
}
喜的朋友我在等待UR答复plz帮助找到一种方法将图片附加到Android电子邮件 – 2010-09-13 04:40:01
我得到了我们需要指定 – 2010-09-14 08:55:47
你不应该需要对电子邮件 – 2011-03-03 12:39:24