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.
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:
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).
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)