问题
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