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
915 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The goal of this video is to provide viewers with basic examples to understand and use structures 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.

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now