The email tools for iOS are quite extensive… however this is not so for macOS
there is no direct support for BCC, CC , or mixed content body (just plain text)
Does anyone have (or know) of a Swift Module that does support all this.
I can do some of it like BCC and CC using a “mailto” URL, but I’d like to do this a more “proper way”
class SendEmail: NSObject {
static func send() {
let service = NSSharingService(named: NSSharingService.Name.composeEmail)!
service.recipients = ["email@yourEmail.eu"]
service.subject = "Email Subject"
service.perform(withItems: ["Email Content"])
}
}
nm - there doesnt appear to be any params/methods for bcc, cc etc exposed this way
and apple docs suck so bad now …
you get a service provider reference back but its pretty opaque
not with a mailto url that I know of
the URL handler just takes the URL and knows what to do with it - open mail & create a new mail with the right to, from, cc, bcc etc fields already filled in
The user has to actually click send
I did notice on SO there were some users also wanting to send emails automagically and there just didnt seem to be a decent way with whats exposed to Swift
One commented they used postfix, another mail service that is often running locally, to do that
Can’t use postfix as some ISP (including my own) block that method
Don’t want to use AppleScript as that is (my understanding) no longer AppStore acceptable
I’m using MailJet APIs in both macOS and iOS to send email silently.
MailJet APIs support cc/bcc, text/html message, subjects, attachments …
My apps are using MailJet for:
Thanks, but for this project using a 3rd party program is not an option.
This is a framework to aid developers in creating programs (in a way similar to Xojo) and need to rely on just what the OS provides