On Dec 12, 2011, at 12:17 PM, Neal Culiner wrote:
> Anyone see anything wrong with what I’m doing?
No. What API level and device are you having problems on? The following nearly
identical code works for me:
var recips = new string[] { "[email protected]" };
string MessageBody = "This is the message body!";
var intent = new Intent(Intent.ActionSend);
intent
.PutExtra(Intent.ExtraEmail, recips)
.PutExtra(Intent.ExtraSubject, "Android App Bug Report")
.PutExtra(Intent.ExtraText, String.Format("{0}\n\n",
MessageBody))
.SetType("application/octet-stream");
if (File.Exists(filePath))
{
Java.IO.File file = new Java.IO.File(filePath);
var uri = Android.Net.Uri.FromFile (file);
Log.Info ("*jonp*", "File URI: {0}", uri.ToString ());
intent.PutExtra(Intent.ExtraStream, uri);
}
try
{
StartActivity(Intent.CreateChooser(intent, "Send E-mail
Using..."));
}
catch (Exception ex)
{
Log.Info ("*jonp*", "Exception! {0}", ex);
Toast.MakeText(this, "There are no e-mail clients installed.",
ToastLength.Short).Show();
}
The email I received does contain an attachment that contains data.
Thanks,
- Jon
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid