Search Unity

Application.OpenURL issue with attachment to Email

Discussion in 'Editor & General Support' started by gwhitcher_unity, Feb 24, 2021.

  1. gwhitcher_unity

    gwhitcher_unity

    Joined:
    Jan 15, 2018
    Posts:
    45
    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.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,752