如何在 xcode 上创建电子邮件表单?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5112946/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I do an email form on xcode?
提问by inVINCEable
How do I do an email form on xcode?
如何在 xcode 上创建电子邮件表单?
ie: With a text field, a sender's email address field, and a sender's name field.
即:带有文本字段、发件人的电子邮件地址字段和发件人的姓名字段。
回答by Alan Zeino
MFMailComposeViewController *mViewController = [[MFMailComposeViewController alloc] init];
mailViewController.mailComposeDelegate = self;
[mailViewController setSubject:@"SUBJECT_HERE"];
[mailViewController setMessageBody:@"MESSAGE_HERE" isHTML:NO];
[self presentModalViewController:mViewController animated:YES];
[mViewController release];
回答by shortkaik
If you'd like to send an e-mail from within your iOS application, you will want to use the MFMailComposeViewControllerclass. You can find the documentationand some useful sample codeat Apple's iOS Reference Library.
如果您想从您的 iOS 应用程序中发送电子邮件,您将需要使用MFMailComposeViewController该类。您可以在 Apple 的 iOS 参考库中找到文档和一些有用的示例代码。

