NSSharingService unable to send attachments in MacOS 10.13 high Sierra

I am trying to send an email with tar/zip attachment. I am adding local file url to the sharing items.it is working fine with OSX 10.12 but the same code is not working with OSX 10.13.it is successfully sending mail to recipients,but recipient is unable to open the file

Below is the code I am using to share an email attachment,


let service = NSSharingService(named: NSSharingServiceNameComposeEmail)!

 service.recipients = ["xyz@dom.com"]

service.subject = "xyz software"

let urlPath = NSBundle.mainBundle().pathForResource("xyz", ofType: "tar")

let url = NSURL.fileURLWithPath(urlPath!)

service.performWithItems([url,"This is an email for auto testing through code."])


Please let me know how to fix the same in OSX 10.13

I am facing same issue in Mac OS Catalina, unable to compose email, NSSharingService only opens my default browser.
Please let me know if you have found issue
NSSharingService unable to send attachments in MacOS 10.13 high Sierra
 
 
Q