Since discovering the D.P.F Delphi iOS Native Components, I have been playing with some of the demos in order to have a better understanding of the components themselves.
Using Delphi XE8, I am currently testing the 'MailCompose' demo. I have no problem with the demo itself if I run it as is. Indeed, this works properly (the e-mail is sent to my e-mail app):
SL := TStringList.Create;
try
SL.Add( 'This is a sample attachment file content. create by TDPFMailCompose' );
SL.SaveToFile( GetTempDirectory + 'DPFSampleAttach.txt' );
if not DPFMailCompose1.MailCompose( DPFTextFieldSubject.Text, DPFTextViewBody.Text, False, [DPFTextFieldRecipient.Text], [], [], [GetTempDirectory + 'DPFSampleAttach.txt'] ) then
ShowMessage( 'Sorry' + #10#13 + 'You cant send eMail '#10#13 + '1) Your Device not support eMail Compose' + #10#13 + '2) You not have a Mailbox' );
finally
SL.Free;
end;
However, if I attempt to request a user confirmation (via a call to 'MessageDlg') prior to calling 'DPFMailCompose1.MailCompose,' the e-mail is not sent to my e-mail app:
if (MessageDlg(('Do you really want to send an e-mail?'), TMsgDlgType.mtConfirmation, [TMsgDlgBtn.mbYes, TMsgDlgBtn.mbNo], 0, TMsgDlgBtn.mbNo) = mrNo) then
Exit;
SL := TStringList.Create;
try
SL.Add( 'This is a sample attachment file content. create by TDPFMailCompose' );
SL.SaveToFile( GetTempDirectory + 'DPFSampleAttach.txt' );
if not DPFMailCompose1.MailCompose( DPFTextFieldSubject.Text, DPFTextViewBody.Text, False, [DPFTextFieldRecipient.Text], [], [], [GetTempDirectory + 'DPFSampleAttach.txt'] ) then
ShowMessage( 'Sorry' + #10#13 + 'You cant send eMail '#10#13 + '1) Your Device not support eMail Compose' + #10#13 + '2) You not have a Mailbox' );
finally
SL.Free;
end;
Am I missing something?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I remember trying this too. I think the Messagebox is place behind the mail screen. I wonder if using an anonymous method would allow it to work correctly.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Since discovering the D.P.F Delphi iOS Native Components, I have been playing with some of the demos in order to have a better understanding of the components themselves.
Using Delphi XE8, I am currently testing the 'MailCompose' demo. I have no problem with the demo itself if I run it as is. Indeed, this works properly (the e-mail is sent to my e-mail app):
However, if I attempt to request a user confirmation (via a call to 'MessageDlg') prior to calling 'DPFMailCompose1.MailCompose,' the e-mail is not sent to my e-mail app:
Am I missing something?
I remember trying this too. I think the Messagebox is place behind the mail screen. I wonder if using an anonymous method would allow it to work correctly.