this code works fine but it pops a window, then have to click send. Can I send it in the background without pops a window? Thank everybody!
import Cocoa
class SendEmail: NSObject {
static func send() {
let service = NSSharingService(named: NSSharingServiceNameComposeEmail)!
service.recipients = ["abc@dom.com"]
service.subject = "Vea software"
service.performWithItems(["This is an email for auto testing through code."])
}
}
SendEmail.send()