Emailing an image from an application

后端 未结 2 1237
失恋的感觉
失恋的感觉 2021-01-15 05:35

What\'s the best way of sending an email with an image from the application to the Mail.app for someone to send to any contact they like?

For example, in my app (iMo

相关标签:
2条回答
  • 2021-01-15 06:09

    This question has been answered many times and in many different forms.

    Short answer: you can't. There is no API that allows you access to Mail attachments, and Apple's implementation of the mail URL scheme does not support attachments either.

    To accomplish this, you have a couple of very unattractive options:

    1) Build-in your own SMTP client. There are some Open Source libraries that are working toward this, but it's still a pain

    2) Send the image to a third part server (yours) and compose and send the mail from there. Users probably won't like the possibility you collecting email addresses for nefarious purposes.

    In your case, the best thing to do is save the image to the Photo Library. From there, users can send email with the photo.

    If you'd like to see Apple enable email attachments, please file a request.

    0 讨论(0)
  • 2021-01-15 06:24

    It's possible and David J. Hinson has written a good blog entry about it here

    0 讨论(0)
提交回复
热议问题