Screenshot Capture to Email

4

Attached Files

The following files have been attached to this tutorial:

.capx

screenshot-to-email.capx

Download now 178.02 KB

Stats

3,327 visits, 4,589 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 29 Jul, 2017. Last updated 28 Mar, 2019

Main aim of this Tutorial

This Tutorial will show you how to send a screenshot to an Email address from C2

Works in Construct2.

Works in Construct 3, but you need a https secure server.

And in C3 you need to Add these 2 events.

And delete the top line from this event

N.B Email can take anywhere up to 15 minutes to be delivered.

This may not work for everybody, due to different email providers and permissions.

Only tested in chrome, and works in gmail and hotmail for me.

Check your Spam / Junk mail also.

Step 1

You will need your own Web host.

You will need to be able to upload FTP files up to your web host.

You will need an installed copy of Construct2.

Step 2

Download the capx that I have provided.

Step 3

You need to open the Capx, and change the Ajax event which sends the information to a PHP Script, with your details, to do this double click on the Ajax event and change the myweb.com in the URL text box, example below.

     "http://www.myweb.com/c2mail.php"

To your server address.

I have fully commented the Capx, It basically Takes a Screenshot, sets it to a Variable, then sends the information to a PHP Script on your Server.

Step 4

I have included the PHP file in the capx, under Files, in the Project Bar, all you have to do is open it, change a few lines.

Change myweb as seen below to your server address.

    $add = '"http://www.myweb.com/' . $file . '"';


Change the From and Reply-to address below.

    $headers .= 'From: mecea@myemail.com' . "\n" .
    'Reply-To: mecea@myemail.com' . "\n" .
    'X-Mailer: PHP/' . phpversion();



When you have changed these lines you need to save the file locally with the file name c2mail.php , and then upload it to your Server.

Step 5

Create upload folder

All the Screenshots are saved to a folder called upload on your server so you have to create this folder.

Step 6

Try it !

Open the capx, and send an email to yourself

If all goes well, you should receive an email, within about 1-15 minutes.

You can check if the file has saved, if you go into the upload directory that you had previously created there should be a .png file there, it will look something like this.

mecea@myemail.com.png

Good luck !

.CAPX

screenshot-to-email.capx

Download now 178.02 KB
  • 1 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • very nice, it works but the attached image is only a strange thumbnail and even in upload, the saved image does not open in browser or in paint, can you fix it?