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 12-04-2009, 03:01 PM   #1 (permalink)
iPhone SDK fanatics!
 
Join Date: Aug 2009
Location: Malaysia
Posts: 370
Default Programatic email generation

Hi, need help. I need to programatically generate an email with the following default:


subject: Check this out dude!
Text: Hi buddy, check this app out in the app store ...


Other, I wan to let user choose from iPhone Contact.


How can I do please? Where to begin with?

Thanks.
__________________
KennyChong
iPhone SDK Fanatic!
KennyChong is offline   Reply With Quote
Old 12-04-2009, 07:50 PM   #2 (permalink)
Registered Member
 
Join Date: Oct 2009
Posts: 62
Default

Hi Kenny,

check the documentation for

MFMailComposeViewControllerDelegate

The MailComposeView will automatically integrate the user's address book and will not cause the application to quit.

Of course, your view class must conform to the MFMailComposeViewControllerDelegate. Then create a composer object

Code:
MFMailComposeViewController *sendEmailComposer = [[MFMailComposeViewController alloc] init];
and add predefined text and other options with the following code:

Code:
sendEmailComposer.mailComposeDelegate = self;
[sendEmailComposer setSubject:@"Check this out dude!"];
NSString *emailBody = @"Hi buddy, check this app out in the app store ...";
[sendEmailComposer setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:sendEmailComposer animated:YES];

Don't forget to implement the mailComposeController: delegate method when the user dismisses the composer:

Code:
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error 
{    
	[self dismissModalViewControllerAnimated:YES];
}
ff10 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,485
Threads: 89,094
Posts: 380,133
Top Poster: BrianSlick (7,091)
Welcome to our newest member, janice23
Powered by vBadvanced CMPS v3.1.0

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