In my app i am pre-filling the email address when the user wants to email someone. i do this like this:
NSArray *toRecipients = [NSArray arrayWithObject:@"[email protected]"];
NSString *subjectStr = [[NSString alloc] initWithFormat:@"test subject"];
MFMailComposeViewController *mailController = [[MFMailComposeViewController alloc] init];
mailController.mailComposeDelegate = self;
[mailController setToRecipients:toRecipients];
[mailController setSubject:subjectStr];
[self presentModalViewController:mailController animated:YES];
[mailController release];
[subjectStr release];
this all works fine with no problems. However, i wanted to know if there was a way to change what showed in the "To:" field once the email opens.
For example, instead of showing - [email protected], i would like it to show "Microsmith Sales".
Is that possible?
thanks in advance
Yep, just change the way your recipient strings are formatted:
NSArray* recipients = [NSArray arrayWithObject: @"Sales Dept <[email protected]>"];