开发者

In app mail with pre added text objective-c

开发者 https://www.devze.com 2023-03-14 23:35 出处:网络
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.

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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号