Latest Delphi
Trying to send email from Android that is always sent to one address but can have up to 3 CC addresses......the send to address shows up ok in the email but not any of the CC addresses. The code I use is shown below.
Intent := TJIntent.JavaClass.init(TJIntent.JavaClass.ACTION_SEND);
sRecipients := TJavaObjectArray<JString>.Create(1);
sRecipients.Items[0] := StringToJString(Recipient);
ccRecipient := TJavaObjectArray<JString>.Create(1);
ccRecipient.Items[0] := StringToJString(ccTechs);
Intent.putExtra(TJIntent.JavaClass.EXTRA_EMAIL,sRecipients);
Intent.putExtra(TJIntent.JavaClass.EXTRA_CC, ccRecipient);
Intent.putExtra(TJIntent.JavaClass.EXTRA_SUBJECT, StringToJString(aSubject));
Intent.putExtra(TJIntent.JavaClass.EXTRA_TEXT, StringToJString(aBody));
Intent.setType(StringToJString('plain/text'));
TAndroidHelper.Activity.startActivity(TJIntent.JavaClass.createChooser(Intent,
StrToJCharSequence('Which email app?')));
The ccTechs variable is a string of addresses - each address separated by a comma.
All works fine except the ccRecipient is always missing.
Can someone please explain what I am doing wrong.
Thanks in advance
Bill Zwirs