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?
问题:
回答1:
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
回答2:
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 :)
回答3:
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.