【问题标题】:how to use and send email using mime in swift如何在 swift 中使用 mime 使用和发送电子邮件
【发布时间】:2016-11-21 00:23:19
【问题描述】:

我是 swift 新手,我使用的是 swift 2.2 版。

我想使用 swift mime 发送电子邮件。为此,我已经浏览了这个链接

http://swiftmailer.org/docs/messages.html

但我不能在我的快速代码中使用require_once 'lib/swift_required.php'

如何在我的 osx swift 项目中使用它?

【问题讨论】:

  • 这个“Swift Mailer”的东西和苹果的编程语言 Swift 无关,它是 PHP 的。
  • @EricD 那么有什么链接或方法可以在 swift osx 中使用 mime 发送电子邮件......谢谢
  • 谁能给我一个链接如何从我的osx项目usign swift发送电子邮件...我搜索了很多但没有找到结果...一切都在ios上

标签: swift xcode macos swift2


【解决方案1】:

Apple 的SBSendEmail Framework 包含一个示例项目。 Controller 类的接口包含一个sendEmailMessage: 方法。

@property(retain, readwrite) NSTextField *toField;
@property(retain, readwrite) NSTextField *fromField;
@property(retain, readwrite) NSTextField *subjectField;
@property(retain, readwrite) NSTextField *fileAttachmentField;
@property(retain, readwrite) NSTextView *messageContent;

- (IBAction)sendEmailMessage:(id)sender;
- (IBAction)chooseFileAttachment:(id)sender;

通读文档并下载示例项目进行试用。

【讨论】:

    【解决方案2】:

    在 ios 上查看此答案以获取电子邮件:https://stackoverflow.com/a/28963929/4687211,swift mailer 是一些 php mailer,不是 swift

    【讨论】:

    • 我想在 osx 中做,但在你的链接中,ios 中有一些东西
    猜你喜欢
    • 2015-06-20
    • 2011-03-07
    • 2016-01-20
    • 2011-05-23
    • 1970-01-01
    • 2020-04-03
    • 2017-08-07
    • 2021-12-02
    • 1970-01-01
    相关资源
    最近更新 更多