使用 MFMailComposeViewController 而不呈现视图控制器
我正在使用 MFMailComposeViewController 发送带有附件的电子邮件。在所有指南中,它选择将视图控制器呈现为模态视图,以便用户可以更改字段并选择发送或取消。
我不希望人们能够更改我输入的信息,所以我想知道是否可以强制它发送电子邮件而不进入模式视图?
我知道在 mailto 中使用了 url,但相信您无法添加附件。
如果有人知道这是否可能,或者如果他们知道如何做到这一点甚至更好,我将非常感谢您的帮助。
非常感谢。
I am using MFMailComposeViewController to send an email with an attachment. In all the guides it chooses to present the view controller as a modal view so that the user can change the fields and choose to send or cancel.
I don't want people to be able to change the information that I have put in, so I was wondering if I could force it to send the email without going to the modal view?
I am aware of using a url with mailto but believe you can't add an attachment.
If anyone knows if this is possible or even better if they know how to do it I would really appreciate the assistance.
Many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,您不能使用 MFMailComposeViewController 执行此操作。苹果在文档中非常明确地指出,发送电子邮件是在用户的控制之下,而不是你的应用程序。您正在从用户帐户发送电子邮件,您可以理解为什么对电子邮件的访问受到限制 - 如果不是这种情况,垃圾邮件机器人将很容易制作。
由于上述原因,我认为您不会得到一个从应用程序商店批准的用户帐户发送自己的电子邮件的应用程序。
No, you can't do this with MFMailComposeViewController. Apple is very specific in the docs that sending email is under the users control, not your apps. You are sending email from the users account, you can understand why access to the email is restricted I this way - a spambot would be trivial to make if this were not the case.
For the above reason I don't think you'd get an app which sends its own emails from the users account approved for the app store.
未经用户同意,您无法发送短信/电子邮件。但是互联网上有很多网络服务可以发送短信/电子邮件。我猜有些应用程序使用这些服务或使用自己的服务。
另请参阅:如何从 iPhone 应用程序发送邮件?< /a>
You cannot send SMS/Email without user acceptance. But there are a lot of web-services in internet which can send SMS/Email. I guess some app uses those services or uses own.
See also: How can I send mail from an iPhone application?