Click here to Skip to main content
15,889,867 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good day all,

I recently ran into the problem where I found out that Apple does not allow developers to send an email directly from code without user interaction. This causes some difficulties on my app as I need a code generated email which is in HTML format to be sent from my website server to myself, a third party and the user of the app. I have a few questions regarding this:

1. Will it be good or bad practice if I use a PHP script to send the emails for me by calling the script from code?
2. Will doing it this way have my app rejected from app store as I have read that bypassing user interaction in this regard will have the app rejected?
3. There are tons of apps on my iOS device that send emails without me having to interact except for pressing a "submit" button or similar. How are these apps doing it?

Basically, I also need the client to just press a button and 3 emails are sent in HTML format. The client is aware of an email being sent, but I need it in HTML format without the mail client showing up. I have the same app developed on Android and if I cannot have the same flow on Apple devices it kind of breaks look from android to ios. I know this is possible as I have apps on my phone that does it. My question is, are they using PHP scripts? If so, I can do that, but I want to be sure that my app will not be rejected from App Store.

Thanks in advance,
Chris

What I have tried:

I have written a PHP script to bypass user interaction to send the email, but I need to know whether my app will be rejected.
Posted
Comments
Richard Deeming 23-Jan-17 15:21pm    
I suspect the restriction is there to prevent you sending email from the user's account without interaction.

Sending email from your server, using your own account, shouldn't be a problem.
Christopher Smit 23-Jan-17 15:25pm    
Thank you for clarifying that. I assume that doing a call to a PHP script is still the only way of achieving the process? In android I used a Mailer.jar library. Is there anything similar in iOS or is it only the above mentioned that is used by all developers?
Richard Deeming 23-Jan-17 15:34pm    
I don't know - I haven't done any iOS development.

You just need to find a way to make a GET or POST request to an HTTP/HTTPS endpoint. This library[^] looks like it might help.
Christopher Smit 23-Jan-17 15:39pm    
Perfect. Thank you!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900