I have the need to send automatic emails in a Swift project I\'m working on. So far my best lead seems to be using Mailgun. (I\'m open to better options if anyone has liked
I think i am facing exactly the same problem with you. But I am a little confused on how many .h and .m files you have used and what each one contains. I am clueless on obj C so I try to follow you blindly.
Correct me if I am wrong.
• You have one .h bridging header file that contains:
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import "AFNetworking.h"
#import
• You have one .m file that contains:
#import
#import
@interface mailTest: NSObject
- (void) sendMail: (NSString*)email;
@end
• And in your Viewcontroller.swift you have (lets say in a button) this:
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
@IBAction func myButton(sender: UIButton) {
var test: mailTest = mailTest()
test.sendMail("testemail@testemail.com")
}
}
Is that correct?