I am new to iPhone app development. I have a form that the user can fill out to request additional information about my product. I would like the app to automatically send out the email without launching UI.
I have looked through several posts that have recommended using ASIHTTPRequest to "Post" data. However most of the posts are dated back to 2009. My question is that using Xcode 4 is there another way of accomplishing the same thing without using ASIHTTPRequest?
Thanks
T!
If you want to send emails without the standard mail composer you have to
ask the user for his email address
implement SMTP. And SMTP is more complex than a simple POST to http.
Alternatively you could set up a script on a web server to which you send the mail address you got from the user.
Related
I'm new in swift programming and I'm working on simple app. However, I was wondering if I can build "Contact us" view controller where the user enters his message and his data sent to me by email. Is it possible?
example:
There are two approaches to send mail from iPhone SDK
You could try MFMailComposeViewController to send an email.
You could set up a web server from where you could send the email with the help of web services.
I’ll suggest building a web service, post this data as a JSON object, make a fancy email at server end and shot it to concerned email id, you have an option to do any additional task.
Like storing a data to db, tagging it specific way and filtering emails from blacklisted email ids.
You can use mail gun or mail trap to help you setup simple way.
I am so confused. My simple requirement is: i have an application which contains confirmation form i.e. nib file. It contains some textFields like name, age, email etc. I simply want when somebody click on submit button application send background and automatic email to email defined in textField. that email contain all information like name, age etc. User need not to fil anything and it should work in background. There are so many application do the same thing. I am creating booking application.
So how can i impliment this behaviour.
Apple does not provide a way to do this - and for good reason. Sending emails from the phone automatically introduces a lot of security risks.
I am willing to bet that the apps that do this use an intermediary server to which they post the data. When the data is posted then the server handles the sending of the emails.
To do this:
Send an HTTPS POST request to your server application.
From your server application, send an email via SMTP (or APIs built on top of SMTP).
Google AppEngine provides a simple and cheap way to create such a web service, running on top of Google's cloud-computing infrastructure. The sending mail from AppEngine help document includes detailed examples of how to send mail from your server application (assuming you use the Python version of Google AppEngine).
Unfortunately, there is no official feature for this but you could download a third-party library. Refer here for a couple of suggestions.
I have seen some similar questions here on stack-overflow, but in my application i want when user click on confirm button automatic email go to the email id specified in the form with other details.
How can i implement this.
You could just make a post request to a server and have the server then send the email.
You cannot send emails automatically without sending the user to the mail application. You could however, take advantage of a third party service like Amazon Simple Email Service http://aws.amazon.com/ses/ to send the message.
Here In My app, There is a case where User registering a form
He will give his mail id in one textfield. After Complete the form I need to send a mail to User for conformation of his registering.
Any one can help me please.
Thanks In Advance
I don't think its the right way to send email from the phone to the user's email id. You need to process the form at a remote server and it should send the confirmation email which most of the phone apps with user registration do. If you are going to save the user data locally, there will be several problems and the top problem would be rejection of the app from apple.
actually its pretty simple, you just have to connect to mail server and send commands
http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
I want to send mail from an iPhone app without showing an MFMailComposeViewController. I also want this mail to be sent from the user's default Mail account. Is it possible to do this?
This is not supported by the iPhone SDK, probably because Apple doesn't want you to do it.
Why not? My guess: Because it's easy to abuse. If we knew user's email address, we could spam them, we could fake emails from them, etc. Imagine finding out an iPhone app sent an email as you without your knowledge -- not cool, even if the app had good intentions.
So, anything you do to get around that, is likely to get you rejected from the app store.
Having said all that, you could basically write your own smtp interaction code to chat with the user's outgoing mail server. For example, if the user has a gmail account, you could ask them for their email and password, you'd have to know how to talk to the gmail servers, and send email through them.
Going that route means asking the user for their username, password, and either asking for or figuring out their mail server information. Another choice is to send directly from the phone (your own smpt server, not just a client), which is a bit more coding. And if you write your own server, the mail you send is more likely to be blocked since your originating IP might not match the domain on the sender's email.
There also exist some libraries that might help out. Previous related question:
Open Source Cocoa/Cocoa-Touch POP3/SMTP library?
There are legitimate reasons for wanting to send an email. (Such as communicating with a server using SMTP instead of HTTP)
This blog post should get you going: http://vafer.org/blog/20080604120118
It is possible to use MFMailComposeViewController without user interaction. See my answer on the iPhone send email not using MessageUI question.