2011-11-10 7 views
0

これはメールを送信しますが、添付ファイルは表示されません。Androidでメールでファイルを送信する方法

{ 
     Intent mailIntent = new Intent(Intent.ActionSend); 
     mailIntent.SetType("text/csv"); 

     mailIntent.PutExtra(Intent.ExtraEmail, new string[]{"[email protected]"}); 
     string path = root + nameFile; 


     mailIntent.PutExtra(Intent.ExtraStream, Android.Net.Uri.Parse (@"file:/" + path)); 

     StartActivity(Intent.CreateChooser(mailIntent, "Send mail...")); 
} 

答えて

-1
 Intent mailIntent = new Intent(Intent.ActionSend); 
     mailIntent.SetType("text/csv"); 

     mailIntent.PutExtra(Intent.ExtraEmail, new string[]{"[email protected]"}); 
     //string path = root + nameFile; 

     mailIntent.PutExtra(Intent.ExtraStream, Android.Net.Uri.Parse("file:///sdcard/ejemplo.csv")); 

     StartActivity(Intent.CreateChooser(mailIntent, "Send mail...")); 
関連する問題