Following some other Stack Overflow code examples of NSWorkspace.shared.open()
, I came up with this:
@IBAction func mailFileVacuum(_ sender: NSButton) {
let receiver = sender.alternateTitle
let sendAddress = String(format: "mailto:%@@filevacuum.com?subject=FileVacuum %@", receiver, receiver).addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)!
NSLog("receiver %@", receiver)
let mailUrl = URL(string: sendAddress)
NSLog("mailUrl %@", mailUrl!.absoluteString)
if NSWorkspace.shared.open(mailUrl!) {
print("Default browser was successfully opened to send email. ")
}
}
☝️ that gets us this
I tried changing the default browser, that's not the issue.
NSLog(mailUrl)
logs this mailto%3AFeedback%40filevacuum.com%3Fsubject=FileVacuum%20Feedback
Look good maybe ...
¿Que Paso?