Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Is there ANY way to send an email fron a WebGL build with a screen capture of the game? -- HELP!

Discussion in 'Web' started by Juang3d, May 10, 2016.

  1. Juang3d

    Juang3d

    Joined:
    Sep 25, 2012
    Posts:
    87
    Hi there.

    I need to send a screen capture from my game via email from within the game, the destination will be fixed, and the origin can be fixed too, I don't need the user to enter his email, and I don't need the user to enter the receiver.

    IS THERE ANY WAY?

    I'm in a big hurry, please!

    Thanks in advance!!!!
     
  2. dkyokusz

    dkyokusz

    Joined:
    Feb 14, 2013
    Posts:
    2
    I also need this urgently... have you found out something?
     
  3. alexsuvorov

    alexsuvorov

    Unity Technologies

    Joined:
    Nov 15, 2015
    Posts:
    327
    Hello Juang3d and dkyokusz.

    It is not possible to send an email directly from JavaScript because it would require establishing a direct tcp connection.
    However, there are other ways to achieve this:

    1) send the image data to your server (php, node etc.) or a 3rd party service (mandrill etc.) which can then handle it and send an email to the provided address (this is very much possible, let me know if this solution is appropriate for you).

    2) open a mail client from JavaScript using mailto: and add the base64 encoded image into the email body (the user will need to click the 'Send' button in the opened window, if the user has an email client installed in the first place, so this way is a bit inconvenient)
     
    Last edited: May 23, 2016