android - Attached image is not getting to the mail -
intent emailintent = new intent(android.content.intent.action_send); emailintent.settype("image/jpg"); emailintent.putextra(android.content.intent.extra_email, new string[] {"me@gmail.com"}); emailintent.putextra(android.content.intent.extra_subject, "test subject"); emailintent.putextra(android.content.intent.extra_text, "go on read emails"); log.v(getclass().getsimplename(), "sphotouri=" + uri.parse("file:///sdcard/2944154479.jpg")); emailintent.putextra(intent.extra_stream, uri.parse("file:///sdcard/2944154479.jpg")); startactivity(intent.createchooser(emailintent, "send mail..."));
i used above code send image email,email page shows file attached getting message,attachment not getting mail.
please help in advance
please seek below code work you.
intent emailintent = new intent(android.content.intent.action_send); emailintent.settype("jpeg/image"); emailintent.putextra(android.content.intent.extra_email, new string[] { "" }); emailintent.putextra(android.content.intent.extra_subject, "subject"); date cal = calendar.getinstance().gettime(); emailintent.putextra(android.content.intent.extra_text, "body"); uri uri = uri.fromfile(new file(environment .getexternalstoragedirectory(), "/hb.jpg")); emailintent.putextra(intent.extra_stream, uri); emailintent.settype("text/plain"); startactivity(intent.createchooser(emailintent, "send mail..."));
android
No comments:
Post a Comment