I am sending email in xamarin android using this code. email is sending without attachment. not getting any error but attachments are not sending with the email.
` public void SendEmail(string toEmail, string subject, string text, string filePath)
{
var intent = new Intent(Android.Content.Intent.ActionSend);
if (!string.IsNullOrEmpty(toEmail))
intent.PutExtra(Intent.ExtraEmail,
toEmail.Split(new[] { ',', ';', ' ' }, StringSplitOptions.RemoveEmptyEntries));
if (!string.IsNullOrEmpty(subject))
intent.PutExtra(Intent.ExtraSubject, subject);
if (!string.IsNullOrEmpty(text))
intent.PutExtra(Intent.ExtraText, text);
if (!string.IsNullOrEmpty(filePath))
{
var file = new File(filePath);
file.SetReadable(true, false);
var uri = Uri.FromFile(file);
intent.PutExtra(Intent.ActionView, uri);
}
intent.SetType("text/plain");
var intentChooser = Intent.CreateChooser(intent, (string)null);
intentChooser.AddFlags(ActivityFlags.NewTask);
CrossCurrentActivity.Current.Activity.StartActivity(intentChooser);
} `