Ambiguity regarding EmailAttachment?

Does anyone know if the following code from the language reference only opens on OS X, - OR, will it open whatever mail client is set to the default?
It opens up fine, but I’m not sure what would happen if the user is using a different default email client?

Language Reference Link

Thank you all in advance.

The code from the language reference will create a mail and add an attachment in code. It doesn’t touch at all. What do you want to do?

I presumed it would create a new email message with a file inserted as an attachment.

The code you see is intented to be used with a SMTPSocket object.
the SMTPSocket can be used to send email via the SMTP protocol directly from a Xojo app, and does not depend on the mail client installed on the user computer

I simply want to insert a file as an email attachment, into an EMPTY mail message in the user’s default mail client.
The user will then complete the To, Subject, and Message Body fields themselves.

This also has to be MAS compliant.
I starting to believe this is impossible :frowning:


You need to use AppleScript… You should be able to modify this code to your needs…

Not impossible - just awkward!

Hopefully my response to the other post will help, but this will only work for Apple mail. Currently there is no simple way to open the user’s default mail client and attach a file. Generating a blank message is one thing, but attaching files is a whole different bag of angry cats.

Not to mention people who use web based mail.

FYI, GMail is second in popularity with 18% market share behind iOS Apple Mail. IN fact, number one for Desktop.

On Desktop GMail is most often used web-based.

Urgh! Think I’m going to throw up.