how to use and send email using mime in swift

若如初见. 提交于 2019-12-13 08:45:39

问题


I am new to swift and i am using swift version 2.2.

I want to send an email using swift mime. For this, I have go through this link

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

But I can not use require_once 'lib/swift_required.php' in my swift code.

How can I use this in my osx swift project?


回答1:


Apple's SBSendEmail Framework is documented with a sample project. The interface for the Controller class includes a sendEmailMessage: method.

@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;

Read through the documentation and download the sample project to try it out.




回答2:


Check this answer for emails on ios: https://stackoverflow.com/a/28963929/4687211, swift mailer is some php mailer not swift



来源:https://stackoverflow.com/questions/38435959/how-to-use-and-send-email-using-mime-in-swift

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