Send by e-mail.

Discussion and feedback on Construct 2

Post » Mon Apr 02, 2012 11:50 pm


Does anyone have an example of how to send the game data by e-mail?
Ex: The points a game
B
3
Posts: 12
Reputation: 299

Post » Tue Apr 03, 2012 11:34 am

I think there might be a way with AJAX or some custom plugin...
I'd be very careful about doing this, however. Most people would not want to receive such emails!
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Tue Apr 03, 2012 3:31 pm

You could tell me how to do with AJAX?
In my game I need the data to be sent by email. Is already defined
B
3
Posts: 12
Reputation: 299

Post » Tue Apr 03, 2012 9:57 pm

As answered in the other thread, you can't send email with JS.
If you want to use Ajax, you need to have a php page on the other end receiving the call and sending a mail after that.
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Tue Apr 03, 2012 10:17 pm

So I call an AJAX-php is already pre configured to send an e-mail? But as I will send the data in AJAX?
B
3
Posts: 12
Reputation: 299

Post » Tue Apr 03, 2012 11:35 pm

Sending an email with php should be an easy task - if you're a little familar with that language:
http://php.net/manual/en/function.mail.php

Then in C2 you can make an ajax request to the php-file. In the tutorials section is an explanation how to use the ajax-plugin. I suppose a GET-request similar as shown in the tutorial will do a good job for the first tests.

[Edit]
..the game data by e-mail.. -> I would never ever do that, but it's possible..
[/Edit]Joe72012-04-03 23:41:08
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Wed Apr 04, 2012 12:36 am

So.
In php okay, I'm familiar with. But how will I make a request through the data in ajax?
B
3
Posts: 12
Reputation: 299

Post » Wed Apr 04, 2012 1:06 am

Ajax plugin sends the data via get.. merge the vars and values in the url..
Php.net getJoe72012-04-04 01:08:20
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Mon Apr 09, 2012 8:45 pm

Got asked for an example. Here it is..
example capx (r85) (you have to change the path to your webserver)
score-php script (without the php-E-Mail-sending routine)
Have fun, Joe7 Joe72012-04-09 22:18:13
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Mon Apr 09, 2012 9:14 pm

The program is claiming that my version is old:
The project was saved in release 85 or 84 newer.Your current release is "

The possibility exists that you save in 84?
B
3
Posts: 12
Reputation: 299

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 15 guests