I found this code for send an email from Delphi application using default email engine
Procedure SendEmail(Const eAddress, eObject, eText, eAttach : String);
var
Intent : JIntent;
D, S : JString;
Begin
Intent := TJIntent.Create;
Intent.setAction(TJIntent.JavaClass.ACTION_Send);
Intent.setFlags(TJIntent.JavaClass.FLAG_ACTIVITY_NEW_TASK);
Intent.putExtra(TJIntent.JavaClass.EXTRA_EMAIL, StringToJString(eAddress));
Intent.putExtra(TJIntent.JavaClass.EXTRA_SUBJECT, StringToJString(eObject));
intent.putExtra(TJIntent.JavaClass.EXTRA_TEXT, StringToJString(eText));
Intent.setType(StringToJString('vnd.android.cursor.dir/email'));
SharedActivity.startActivity(Intent);
End;
The problem is with the attachment. In the original sample code there are a construct like this
Intent.putExtra(TJIntent.JavaClass.EXTRA_STREAM,
TJnet_Uri.JavaClass.fromFile(FileName));
but the FileName must be a JFile.
How can I transform a String into a JFile? Or how can I send an email with attachment passing the file name to the function?