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.
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.
Download the capx that I have provided.
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.
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.
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: 'moc.liameymjbe@em . "\n" .
'Reply-To: 'moc.liameymjbe@em . "\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.
Create upload folder
All the Screenshots are saved to a folder called upload on your server so you have to create this folder.
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.
Good luck !