Using MFMailComposeViewController without presenting the view controller

本秂侑毒 提交于 2019-12-25 02:43:36

问题


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.


回答1:


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.




回答2:


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?



来源:https://stackoverflow.com/questions/8194276/using-mfmailcomposeviewcontroller-without-presenting-the-view-controller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!