Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-29-2009, 10:55 AM   #1 (permalink)
I will be a billionaire.
 
IphoneSdk's Avatar
 
Join Date: Sep 2009
Location: Scarborough, United Kingdom
Age: 16
Posts: 1,292
Default Let user choose who to send email to

Hi,

I want to let the user choose who they want to an email to from my app

To send an email to a certain email address I use this code:

Code:
NSURL *url = [[NSURL alloc] initWithString:@"mailto:k@yahoo.com?subject=This is my subject&body=this is the body"];
[[UIApplication sharedApplication] openURL:url];
In the email that will be sent I want there to be data that the user has typed into a text field in the app.

Any ideas how to do this?

I hope I've explained it properly!

Thanks
__________________
iOS Apps | Website | Twitter | Facebook

Last edited by IphoneSdk; 11-29-2009 at 10:58 AM.
IphoneSdk is offline   Reply With Quote
Old 11-30-2009, 01:33 AM   #2 (permalink)
David Porter Apps
 
bobbypage's Avatar
 
Join Date: Aug 2009
Posts: 71
Default

Try using the MessageUI.Framework. It should work for your case. Just set the Message to your text field. For a jump start on using the messageui.framework go here.
Using OpenURL (like you are now) to email, works great for just sending an email and specifying a sender though, if you want anymore functionality, (like you do in your case) give MessageUI a run.
Hope I helped,
-David
__________________
Check out my website/blog: http://www.davidporterapps.com

Follow Me on Twitter:
http://twitter.com/bobbypage
bobbypage is offline   Reply With Quote
Old 11-30-2009, 01:36 AM   #3 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
Default

If you're targeting 2.0 you can stick with mailto: - just leave off the email address, but keep the mailto:?subject=blah+blah+blah

Code:
NSURL *url = [[NSURL alloc] initWithString:@"mailto:?subject=This is my subject&body=this is the body"];
[[UIApplication sharedApplication] openURL:url];
__________________

Free Games!
smasher is offline   Reply With Quote
Old 11-30-2009, 12:06 PM   #4 (permalink)
I will be a billionaire.
 
IphoneSdk's Avatar
 
Join Date: Sep 2009
Location: Scarborough, United Kingdom
Age: 16
Posts: 1,292
Default

Ok, thanks for both of your help!
__________________
iOS Apps | Website | Twitter | Facebook
IphoneSdk is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 158,770
Threads: 89,203
Posts: 380,578
Top Poster: BrianSlick (7,129)
Welcome to our newest member, dentstrybelfst7
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:18 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0