This question already has answers here:
Send an email from my app without using MFMailComposeViewController
(3 answers)
Closed 5 years ago.
I know you can send an email out of your app by presenting the user with a MFMailComposeViewController, but can you also send an email without the user having to push any send buttons?
The simple answer is "No".
It is against Apple guidelines. You cannot send mail without user interaction (action on send button).
As an alternate option, you can use power of web server/web service. Send information/data to your web service using web service request and can send an email from you web server. (Note: Mail sender id will not be email id of application user.)
You can try this but remember, it's against Apple guidelines and Apple may reject your app.
https://stackoverflow.com/a/5183267/5638630
http://iosameer.blogspot.in/2013/01/sending-e-mail-in-background-from-ios_25.html
https://stackoverflow.com/a/6287412/5638630
It is actually not possible to send an email only using your iOS code without MFMailComposeViewController and user's explicit interaction.
But you could upload the content of your mail to a web service of your own or from a third party and that will send it for you. This way the user will not do anything.
Related
I am developing an iOS app targeting iOS 9 and above using Swift 3 and xCode 8.
I have a "Contact ViewController" which contains multiple forms where user enters its data to submit. Collected data also contains users' e-mail address. I am validating all the information that entered by the user correctly.
So, what I would like to do is my "send" button to send the user's all data to an e-mail address.
Is this possible without using Mail App or its interface? Do I need additional framework for such functionality?
I appreciate your time and sharing your thoughts.
This is not possible secretly. You can't send an email from the users device via the Apple Mail app because the system will not allow that. You can prepare an email with all the data that opens and let the user send it to you by tapping "Send" in the NavigationBar. So yes, you would need another framework to do that.
But I would not use emails to do that. Just use a server you send the data to or a service like Firebase.
If you really have to send E-mails, and just pushing the data to a backend API is not enough:
This is not possible using built-in functionality, but you could leverage an external mail delivery service like Mailgun to send your mails. (From a security standpoint, this should be handled by a server and not by the app itself however.)
This question already has answers here:
Sending an automatic Email with Swift and Xcode 6
(3 answers)
Closed 7 years ago.
I have an app where I have a simple form to collect data, and then want to send an email containing that data to a particular email address.
Ideally, I'd just want this to be transparent to the user -they would just press submit/send, and the email would be automatically created and sent in the background to that email address without the user knowing.
I am getting tutorial on this using objective-C but I want to implement this using Swift.
Is there a recommended way to send email in the background?
Apple do not allow you to send emails in the background without user's interaction. The only way you can do this is to use a server to send the email.
There is no way you can do this. Apple doesn't allow sending E-Mails in background. You can set any information about the receiver content and so on, but you also don't know if the user did change anything because you can't access the content through any delegate. Of course you can by the private API but then it would be rejected in the review process.
This question already has answers here:
Can I send email programmatically in iPhone app?
(8 answers)
Closed 7 years ago.
I would like my app to send an email to my email address from another one of my email addresses. Basically I would like to program it such that it has the username and password for the sending address in the code so that it can compose and send an email without the user having to do anything.
To make it clearer, this would be to place an order that I would receive via email. The user selects all the options they want in the app then once the order is confirmed the app will send all the details to me via email.
I could not find any information on this, even whether or not it's possible. Every time I tried to search I just came up with results about how to open the mail view in your app, which is not at all what I want.
I don't necessarily need all the code, even if you could point me in the direction of a tutorial or something it would be greatly appreciated!
You cannot send an email on behalf of the user without presenting the standard email view.
However, there are a few services that you can use to accomplish your goal. Have a look at Mandrill or Mailgun.
Short answer: not allowed by Apple.
Long answer: not allowed by Apple because this would allow programmers to send emails from a user's device without their knowledge or consent.
All I am developing an iPhone application in which I have to send mail to recipient without showing email id and the MFMailComposer UI view (i.e without user interaction and also user cant know who is the recipient). Can please tell me how to achieve this?
You cannot send Email without user acceptance. But there are a lot of web-services in internet which can send Email. I guess some app uses those services or uses own.
See also How can I send mail from an iPhone application
You can create a PHP webpage which uses the mail function, just a couple of lines of code.
Then just call the url to that php webpage from your app!
What I want is to allow user to send and receive mail from my iPad app. I know that I can user MFMAilComposer but it's for sending only as per my requirement I need to provide all functionaly of an iPad email client app.
As far as I know you can send email using your iPhone app either using background or using the POP3/SMTP see the following link.
Open Source Cocoa/Cocoa-Touch POP3/SMTP library?
However, You can not get the emails received in iPhone mail box. But I think you can receive email from your mail server...See this stack overflow link you will get more idea Can receive mail directly from mail server in custom iPhone app?
Hope my answer helps..