如何从 MFMailComposeViewController 获取电子邮件地址

发布于 2024-10-04 03:54:35 字数 338 浏览 8 评论 0原文

应用程序正在使用 MFMailComposeViewController 发送电子邮件,一切正常。但是,发送电子邮件后,需要存储收件人地址以供进一步处理。据我所知,没有可用的 API。

如何获取邮件发送到的电子邮件地址?

  • 我应该子类化 MFMailComposeViewController 并覆盖某些内容吗?那会是什么?
  • 我可以通过查看 MFMailComposeViewController 视图层次结构来查找电子邮件地址吗?我会在那里寻找什么?

还有其他想法吗?

Application is sending email by using MFMailComposeViewController, everything works just fine. However after sending email, the recipient address needs to be stored for further processing. As far as I can tell, there is no API for this.

How do I get the email address where message was sent to?

  • Should I subclass MFMailComposeViewController and override something? What would that be?
  • Could I find email address by looking at MFMailComposeViewController view hierarchy? What would I be looking for there?

Any other ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笑看君怀她人 2024-10-11 03:54:35

找到了部分答案,详细信息如下:

http://jomnius .blogspot.com/2011/02/how-to-find-mfmailcomposeviewcontroller.html

问题:它找到收件人电子邮件地址,但前提是该地址适合大约 35 个字符文本字符串。否则,您只会找到类似于 "[email protected] 的摘要字符串还有 2 个...”。那么在这种情况下,实际的电子邮件地址在哪里呢?

Figured out a partial answer, here's the details:

http://jomnius.blogspot.com/2011/02/how-to-find-mfmailcomposeviewcontroller.html

Problems: it finds the recipient email address(es), but only if that fits in about 35 character text string. Otherwise you find only a summary string like "[email protected] & 2 more...". So where are the actual email addresses in this case?

温柔戏命师 2024-10-11 03:54:35

作为替代 UI 流程——虽然显然我不知道你的应用程序,所以只有你知道这是否可行——你可以让用户在文本字段中输入收件人信息,然后推送邮件撰写视图控制器(使用预先填写的收件人)。

您甚至可以使用 Joe Michel 的多收件人选择器库 使其感觉更像是本地收件人选择。

As an alternate UI flow -- though obviously I don't know your app, so only you'll know whether this can work -- you could instead have the user enter recipient info into a textfield and then push the mail composition viewcontroller (with the recipient(s) pre-filled).

You could even use a variation of Joe Michel's Multi-Recipient Picker library to make it feel more like the native recipient selection.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文