如何发送电子邮件从iPhone应用程序没有用户界面 [英] How to send email from iPhone app without user interface

查看:168
本文介绍了如何发送电子邮件从iPhone应用程序没有用户界面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让我的应用程序能够发送带有附件的电子邮件到硬编码的收件人,不需要用户输入。与MessageUI框架不同。

I want my app to be able to send an email with attachment to a hard-coded recipient with no user input required, unlike the MessageUI framework.

是否有有什么办法吗?任何示例代码将不胜感激。

Is there any way to do this? Any example code would be appreciated.

提前感谢

推荐答案

正如Saurabh所说,没有低级邮件库。我会寻找一个SMTP库,而不是一个IMAP,因为你不需要收到邮件,只是发送它。

As Saurabh said, there is no low level mail library. I would look for an SMTP library, rather than an IMAP one, because you don't need to get mail, just sent it.

附件可以通过MFMailComposeViewController的通过(NSString *)mimeType fileName :( NSString *)filename

Attachments can be done with MFMailComposeViewController's via -(void)addAttachmentData:(NSData *)attachment mimeType:(NSString *)mimeType fileName:(NSString *)filename

我相信只是base64编码数据,并附上一个mime类型的页眉和页脚。

Which I believe simply base64 encodes the data, and attached a mime type header and footer.

查看这个问题的主题:打开源Cocoa / Cocoa-Touch POP3 / SMTP库?

Check out this question for lots on the topic: Open Source Cocoa/Cocoa-Touch POP3/SMTP library?

这篇关于如何发送电子邮件从iPhone应用程序没有用户界面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆