How would you send an automatic email in a swift ios app? I don't want to use MessageUI because it is not automatic. How could you do this?
-
2This looks like a repetition of your previous question http://stackoverflow.com/questions/28963514/sending-email-with-swift. – Martin R Mar 13 '15 at 14:01
-
What's the use case? In your other question you mention password reset, but that would be something handled by the application server that your iOS app was logging into, not the app on the phone itself. – Rup Mar 13 '15 at 14:57
3 Answers
If you're looking to programmatically send emails, I would use MailCore to do this, which can use the SMTP/IMAP protocols. It works on both OSX and iOS too! Here is a great SMTP example in Swift: Sending Mailcore2 Plain Emails in Swift

- 1
- 1

- 773
- 1
- 7
- 9
The thing is that Apple does not allow you to send e-mails in the background. I came across that problem as well. You'll have to let the user confirm to send it. So create the mail and let it pop up, then the user just needs to press send.
Thats unfortunately the only way to do it.
Hope it helps :)

- 27,197
- 29
- 120
- 174
Apple do not allow you to send emails in the background without user's interaction. The only way you can do this with using this blog. http://iosameer.blogspot.in/2013/01/sending-e-mail-in-background-from-ios_25.html. It will surely work for you.

- 467
- 4
- 10
-
It would be better if you can put here the relevant part and not only use a link. Links can disappear over time and makes your answers useless. – King Midas Mar 14 '18 at 10:08
-
1This article gives code in Objective-C. The requirement in the original question says "Swift". – Will Buffington Sep 19 '18 at 03:23