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.
Related
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.
This question already has answers here:
Send an email from my app without using MFMailComposeViewController
(3 answers)
Closed 5 years ago.
Preface: New to coding but have tried to do expensive research without finding anything that I thought would work---so please go easy
I am attempting to create an app that a user will fill out a form of multiple text fields and then when the submit button is touched, it will send the completed fields in an email to one specific email address.
I am stuck at the process of how to send the email with the data entered. I do not want to do this within the app with MFmailcomposer. Can I do this from a back end like firebase for example, or is there a better way to implement---or is this even possible? Hoping someone can at least point me in the right direction, I feel like Ive been stuck for weeks.
Thx
There are services that will send emails for you (like MailChimp). They have an SDK and you'd have to integrate the SDK into your app. Or you could create your own API and call said API through your app and handle the email notifications in your API. Firebase looks like it has custom email options, but only for the Javascript SDK.
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.
I am working on an app that can automatically send a message to some specific ones (either emails or SMS) under some dangerous circumstances.
When someone is in danger, he or she has no time to press the send button. Is it possible for the user to approve sending messages in the app in advance, so the app can automatically send emails or SMS to others without telling the user?
I searched in StackOverflow, but found no similar answers.
This is just for a demo. It does not need to be approved by Apple.
Thanks in advance!
Take a look at the ChatKit framework.
It uses iOS private APIs to do what you want to achieve. Don't try to submit it to Apple though.
With this framework, you can programmatically compose and send text messages through iMessage/SMS.
The iOS SDK class MFMailComposeViewController can be used to let the user compose an email message.
What I'd like to do, is for the iOS app to send an email in the background, with no user interaction. Is this at all possible/allowed in the iOS SDK?
Nope. There isn't any API available to do this. You'd need to roll your own SMTP client and have the user enter credentials into your application. On top of that Apple may not approve this.
Unfortunately, I don't think Apple would ever allow this because (for example) then you could just get everyone's email address by auto-sending mail to yourself. :(
I actually wanted to implement something like this for the express purpose of alerting me when a critical error happens on an app in the app market.
Best solution would be to create an API (just ping a php file or something), and have it send the relative alert message to your email).