In app mail with pre added text objective-c
I have a text field in my app and I want the user to be able to send an email with that text. So in the message part of the email开发者_如何学C the text in the text field will be added.
But I'd also want there to be some pre added text before that too. Here's an example of what I mean:
I just scored: 48213
So the "I just scored:" will the the pre added text and "48213" is the text from the text field.
And this is for iPhone / iOS
Hope this makes sense
mailPicker
is the instance of MFMailComposeViewController
class.
Try with below code.
NSString* myScore = myTextField.text;
NSString* emailBody = [NSString stringWithFormat:@"I just scored: %@",myScore];
[mailPicker setMessageBody:emailBody isHTML:NO];
精彩评论