New line and returns ignored in setMessageBody
Posted
by Magic Bullet Dave
on Stack Overflow
See other posts from Stack Overflow
or by Magic Bullet Dave
Published on 2010-03-31T15:30:28Z
Indexed on
2010/03/31
15:33 UTC
Read the original article
Hit count: 504
iphone-sdk
|mfmailcomposeviewcontroll
Am I doing something dumb? I can pre-fill and email ok but the "\r\n" is ignored in the emailBody:
- (void) sendEventInEmail
{
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
NSString *emailSubject = [eventDictionary objectForKey:EVENT_NAME_KEY];
[picker setSubject:emailSubject];
// Fill out the email body text
NSString *iTunesLink = @"http://itunes.apple.com/gb/app/whats-on-reading/id347859140?mt=8"; // Link to iTune App link
NSString *content = [eventDictionary objectForKey:@"Description"];
NSString *emailBody = [NSString stringWithFormat:@"%@\r\nSent using <a href = '%@'>What's On Reading</a> for the iPhone.", content, iTunesLink];
[picker setMessageBody:emailBody isHTML:YES];
picker.navigationBar.barStyle = UIBarStyleBlack;
[self presentModalViewController:picker animated:YES];
[picker release];
}
Regards
Dave
© Stack Overflow or respective owner