Search code examples
iphoneobjective-ccocoa-touchmfmailcomposeviewcontrollermessageui

How can I append text to the bottom of my MFMailComposeViewController?


I would like to add the text "Sent from " to the bottom of the message

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];
      }

Solution

  • You could set the message body as isHTML:YES and use line breaks <br> or try using \n in the setMessageBody string

    Then just add your "sent from" message after that.