Search code examples
iosiphoneemaildelphidelphi-xe4

Using Delphi xe4, mail client will not open


Referring to a different article/question: Delphi XE4 iOS open email program not working

Same symptoms apply to my situation. When debugging in the iPhone simulator, I can paste into the Safari Web Browser, 'mailto:[email protected]?Subject=test' (or whatever I desire, really) and the simulator then proceeds to open the Apple Mail Client with the specified parameters.

BUT, in my app when using the line:

    OpenURL('mailto:[email protected]?Subject=test');

Well, nothing happens. I can replace the MailTo text with a web address such as, StackOverflow.com, and it works perfectly fine, but just doesn't when attempting to open the mail client.

Using Delphi Xe4, developing an app for iOS. Using the Apple.Utils framework provided with the Delphi Samples.

Am I missing anything? Or is there an easier way to open the mail client?


Solution

  • No one responded. There was an easier way - using an action sheet to perform the same sharing functionality that we see in just about all Apple software products. It is located in an example in the Delphi Samples. You can send text, email, etc. etc. Also can attach pictures.

    Hint: The share feature functionality does not work in the simulator but does actually work on devices.