how to send email without showing compose email UI?

一笑奈何 提交于 2019-12-11 14:55:40

问题


I am writing a program to grab picture from the Photo Album on the device and automatically send it as attachment to an email address. I want to do this without displaying the MFMailComposeViewController UI (the typical iphone send email compose Window). Is this possible? thanks much in advance.


回答1:


It's better include the image as an attachment and show the compose controller. It also lets the user have the final decision who and what to send.

But you can always construct an SMTP message. See Open Source Cocoa/Cocoa-Touch POP3/SMTP library? for example.




回答2:


You can do that, but you need to do this passing through a web server. You upload the photo to a web server, along with all metadata, then it sends the email. Of course, the sender of the email will appear as your server, and not the user.

You could also deploy the application with exim4, for example, but:

  1. I do not think Apple will approve it

  2. even if it's apporved, your emails are very likely to be marked as spam, and you cannot use stuff like SPF, as you are going to send emails from thousands of different IPs.



来源:https://stackoverflow.com/questions/2968635/how-to-send-email-without-showing-compose-email-ui

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