Я хотел бы добавить текст, "Отправленный от" до нижней части сообщения
if([MFMailComposeViewController canSendMail]){
MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
controller.mailComposeDelegate = self;
[controller setSubject:[NSString stringWithFormat:@"A message from: %@",self.profileName]];
[controller setMessageBody:[NSString stringWithFormat:@"%@",self.cellBody] isHTML:NO];
[self presentModalViewController:controller animated:YES];
[controller release];
}
else {
UIAlertView *alertView;
alertView = [[UIAlertView alloc] initWithTitle:@"E-Mail Not Enabled" message:@"E-Mail is not supported on this device" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
[alertView release];
}
Вы можете установить тело сообщения как isHTML: YES
и использовать разрывы строк
или попробовать использовать
\ n
в строке setMessageBody
Затем просто добавьте после этого сообщение «отправлено от».
Попробуйте этот код Я изменил код в соответствии с вашими требованиями
if([MFMailComposeViewController canSendMail]){
MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
controller.mailComposeDelegate = self;
[controller setSubject:[NSString stringWithFormat:@"A message from: %@",self.profileName]];
[controller setMessageBody:[NSString stringWithFormat:@"%@\nSent from : %@",self.cellBody,self.profileName] isHTML:NO];
[self presentModalViewController:controller animated:YES];
[controller release];
}
else {
UIAlertView *alertView;
alertView = [[UIAlertView alloc] initWithTitle:@"E-Mail Not Enabled" message:@"E-Mail is not supported on this device" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
[alertView release];
}
Удачного кодирования...