Solved

In iPad app what would be the easiest way to create a form that will store the data and send it to email?

Posted on 2010-11-11
1
920 Views
Last Modified: 2013-11-25
Hello Experts,

I would like to create an application for iPad that will display a form for people to fill in their details like name, address and the phone number and when they press send button will automatically send it to desired email address. Can someone please help me to write the code for that??

Thank you!
0
Comment
Question by:zelu1984
1 Comment
 
LVL 13

Accepted Solution

by:
SpeedyApocalypse earned 500 total points
ID: 34163853
Well, first, you are going to want to search for MFMailComposer so you can actually send mail within the app (and not have to go out to the Mail.app program).  

Have you had experience with TextFields?  You are going to need a few of these.  You can connect them and have the user enter information.  To access the TextField's text, you can call .text using dot syntax.  For example (myField.text).  I assume you do not want to have blank fields, so before you compose the mail, make sure to add:

if(![myField.text isEqualToString:@""] && ![myField.text isEqualToString@" "]) {

//Do stuff

}

This make sure that the above text field is not empty or just doesn't have a space in it.  

I would personally get all of the text from a text field and add this to an NSString.  I would then correctly format the string so it looks nice and the information is correct (as per what you wanted).  Now, simply call the MailComposer and it will be able to send.  I do not think that you can simply send without the user knowing (there will be some picker that has to be brought up).
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question