Can I send email programmatically in iPhone app?

2019-01-15 01:33发布

I need to be able to send a pre-formatted email or SMS text message programmatically from within an iphone app. Can this be done? I have looked at apple's MFMailComposeViewController class, but this "provides a standard interface that manages the editing and sending an email message" and the MFMessageComposeViewController class also has it's own "standard system interface for composing SMS text messages". These allow you to present an interface to the user where they have to fill in all the data and then explicitly press a send button.

I cannot use this boilerplate functionality.

I need to be able to send a message without presenting any interface to the user. I know this sounds evil, but actually it is for a commercial application which needs to communicate to a user group in a central office when users in the field have performed specific actions out in the field.

Has anyone found a solution to this?

8条回答
等我变得足够好
2楼-- · 2019-01-15 02:06

Here are a few SMTP API's that work on OS X. They might work on iOS as well.

  • Pantomime
  • MailCore
  • EdMessage
查看更多
我想做一个坏孩纸
3楼-- · 2019-01-15 02:10

Set up a web service you can post to using an HTTP request. If you are posting to only one address this can work very well, although you may want to get the user to input their return mail address.

Otherwise only the standard dialog is available (this relies on using whatever account they've setup on the device).

查看更多
登录 后发表回答