1
 Intent intent = new Intent(Intent.ACTION_SENDTO);
 intent.putExtra("address", "12134567899");
 intent.putExtra("sms_body", "See attached picture");


 intent.putExtra(Intent.EXTRA_STREAM,
 Uri.parse("file:///sdcard/DCIM/Camera/2011-09-09 12.47.29.jpg"));
 intent.setType("image/png");


 intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

 startActivity(intent);

i try code like this. if intent start mms compose ui was coming how can i overcome and send automatically

K.Muthu
  • 1,232
  • 1
  • 17
  • 38

3 Answers3

4

First of all. good luck. Since MMS isn't supported by the android sdk, you have 2 options:

  1. download the android mms aplication and try to understand what's going on there.

  2. follow this link: http://androidbridge.blogspot.com/2011/03/how-to-send-mms-programmatically-in.html

only thing I found working at the moment....

zwebie
  • 2,349
  • 1
  • 27
  • 43
  • I'm having a lot of trouble with sending MMS. I would really appreciate it if you could help me! https://stackoverflow.com/questions/47448316/cannot-send-mms – Ruchir Baronia Nov 23 '17 at 05:41
  • @RuchirBaronia Wish I could help you but this was more than 5 years ago and even then I only got it to work on occasion. – zwebie Nov 23 '17 at 19:05
  • Aw that's a bummer. It's okay, thank you so much for your response! – Ruchir Baronia Nov 24 '17 at 21:36
1

This feature was designed as a safety feature in Android, please do not try to bypass it. It's there for a reason.

If you absolutly must, have you tried running it on a rooted device? It allows greater access.

Azulflame
  • 1,534
  • 2
  • 15
  • 30
0

try this its worked with me . use Uri.fromFile instead of Uri.parse

File f=new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/DCIM/Camera/"+img_name);
Intent sendIntent = new Intent(Intent.ACTION_SEND); 
sendIntent.putExtra("", ""); 
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(f));
sendIntent.setType("image/png");  
startActivity(sendIntent);
Hamza Alayed
  • 635
  • 5
  • 17