How to sent an email automatically with Android?

How to send video to email in android programatically

  • I want to send the 30 sec video to email from my android application.i have sent the email with image attachment but it is not working for video.plese help me to do that Thanks in advance. send.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub final Intent emailIntent = new Intent( android.content.Intent.ACTION_SEND); emailIntent.setType("video/3gp"); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { address.getText().toString() }); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText()); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText()); String dataPath = "/sdcard/video0007.3GP"; emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(dataPath)); startActivity(Intent.createChooser(emailIntent,"Send mail...")); } });

  • Answer:

    use this code for pick an video from SD card then send email with video..... Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.setType("video/3gp"); sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Video"); sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://sdcard/dcim/Camera/filename.3gp")); sendIntent.putExtra(Intent.EXTRA_TEXT, "Enjoy the Video"); startActivity(Intent.createChooser(sendIntent, "Email:")); use this code for send email then browse your video...if any error or problem occur...let me know... Edited Answer private void message() { Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND); sharingIntent.setType("text/plain"); String shareBody = "Here is the share content body"; sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject Here"); sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody); startActivity(Intent.createChooser(sharingIntent, "Send via")); }

Rekha at Stack Overflow Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.