This my mail attached Delphi software.
procedure TForm4.CreateEmail(const Recipient, Subject, Content, Attachment: string);
var
JRecipient: TJavaObjectArray<JString>;
Intent: JIntent;
Uri: Jnet_Uri;
AttachmentFile: JFile;
begin
JRecipient := TJavaObjectArray<JString>.Create(1);
JRecipient.Items[0] := StringToJString(Recipient);
Intent := TJIntent.Create;
Intent.setAction(TJIntent.JavaClass.ACTION_SEND);
Intent.setFlags(TJIntent.JavaClass.FLAG_ACTIVITY_NEW_TASK);
Intent.putExtra(TJIntent.JavaClass.EXTRA_EMAIL, JRecipient);
Intent.putExtra(TJIntent.JavaClass.EXTRA_SUBJECT, StringToJString(Subject));
Intent.putExtra(TJIntent.JavaClass.EXTRA_TEXT, StringToJString(Content));
Intent.setType(StringToJString('message/rfc822'));
if Attachment <> '' then
begin
AttachmentFile := TJFile.JavaClass.init(StringToJString(Attachment));
Uri := TJnet_Uri.JavaClass.fromFile(AttachmentFile);
Intent.putExtra(TJIntent.JavaClass.EXTRA_STREAM, TJParcelable.Wrap((Uri as ILocalObject).GetObjectID));
end;
Intent.setType(StringToJString('vnd.android.cursor.dir/email'));
SharedActivity.startActivity(Intent);
end;
Hebrew text
1. Using NORMAL Gamil phone application on attached Hebrew text file. <<<< NO problem
2. Using my Attached function and Gmail application. <<<< Problem
The problem
when sending text file with Gmail one can see the text and the attachment with no problem. !!!!!!!
When sending SAME text file with Delphi software the attachment is OK but the
Hebrew text shown is gibberish.
IF i attach HTML file same problem HTML file OK but it is shown in the main mail
with gibberish for Hebrew.
BE AWARE THAT LOADING THE SAME FILES WITH GMAIL BOTH FILES (text and html) ARE SHOWN OK.
P.S the mail sent is open in windows. I thing it is NOT a problem of Unicode.
Using galaxy s6 phone.