Application.OpenURL issue with attachment to Email

Hi all. I couldn’t find information for this exactly so I thought I would bring it up here.

I want to send an email with an attachment of a file generated by the unity app. I use OpenURL to open the local email client of choice by the user using this command

Application.OpenURL(“mailto:” + emailaddress + “?subject=” + subject + “&body=” + body);

I would like to add an attachment and I tried using this:
Application.OpenURL(“mailto:” + emailaddress + “?subject=” + subject + “&body=” + body + “&Attachment=” + Application.persistentDataPath + “/whateverfile.xxx”);

of course that didn’t work. I want the user to use their native email client to send it as I want them to know what is in it and give them the opportunity to add recipients, notes or whatever.

Is there a way to add attachments this way? Thanks in advance.

For one, this :

But it suggests a lowercase “a” on attachments.

There is another link lower that page.

Use “share” instead.

Like this:

var targetPath = Path.Combine(Application.temporaryCachePath, "some_file.png");
new NativeShare().AddFile(targetPath).SetSubject("Subject").SetText("AttachmentName").AddEmailRecipient("email@example.com").SetCallback((shareResult, shareTarget) => {
        Debug.Log($"shareResult {shareResult} shareTarget {shareTarget}");
    }).Share();