how to send email in iphone SDK? any example tutorial to take email address from iphone also?
+2
A:
The answer is, use Stackoverflow's search feature, literally tons of code samples for sending mail and selecting email addresses. Specifically, try a search on MFmailcompose.
Jordan
2009-10-03 10:13:55
+3
A:
You should use the MFMailComposeViewController
class, and the MFMailComposeViewControllerDelegate
protocol, that that tucked away in the MessageUI framework.
First to send a message:
MFMailComposeViewController* controller = [[MFMailComposeViewController alloc] init];
controller.mailComposeDelegate = self;
[controller setSubject:@"My Subject"];
[controller setMessageBody:@"Hello there." isHTML:NO];
[self presentModalViewController:controller animated:YES];
[controller release];
Then the user does the work and you get the delegate callback in time:
- (void)mailComposeController:(MFMailComposeViewController*)controller
didFinishWithResult:(MFMailComposeResult)result
error:(NSError*)error;
{
if (result == MFMailComposeResultSent) {
NSLog(@"It's away!");
}
[self dismissModalViewControllerAnimated:YES];
}
PeyloW
2009-10-03 10:30:00