EmailMessage in iOS

In EmailMessage — Xojo documentation it states: ’ Compatibility, All project types on all supported operating systems.', which doesn’t appear to be true for iOS.

Does anyone have a suggestion on how I can send and email with an text file attached?

Thanks - Chris

iOS may block direct mail sending as a security limitation, but you can use iOSKit and MFMailComposeViewController to send mail with attachments, but you need to show the UI, and the mail gets sent through Apple’s Mail app (or perhaps whatever the default email app is).

If you need to send transactional emails without displaying any UI to the user I can share code to send emails with Sendgrid.

I sent close to a million emails using Sendgrid and it works great!

Thanks John. I’m using Jason’s iOSKit in my app and a lot of it still works great, but MFMailComposeViewController has stopped working in recent Xojo releases (I did the API2.0 conversion … :roll_eyes:), which worked for a while, but now, no longer. I’m thinking about sending the file through a TCP socket now, which should okay as the file is quite small.

Thanks Jeremie. That’s not a bad suggestion. I’m always struggling sending emails from the various platforms. I can ask their support, but, off-hand, do you know if you have to subscribe to the higher subscriptions to allow people from different email domains send through the app or does everything come from basically one email?

Transactional email should always be sent from a verified domain and possibly an authorized email address. I usually declare on Sendgrid each email address I’m going to use.

However, the reply-to address can be set to whatever address you want.

Thanks Jeremie - I think, from past experience, if the domain differs in the reply-to, it can often had to the spam folder for the recipient.