sending and Email

brantsmith

  • Posts: 151
Is there any way to send info created in game to an e-mail. (Ex. Send game scores to a certain e-mail) I was wondering if maybe it could be done through the *code* block. (Does the code block take AS3 or some other type of code.) anyway, thank you.
Coding is Awesome.
Stencyl is Better.

Joe

  • *
  • Posts: 2480
Hi brantsmith.

You can't send emails directly from StencylWorks. You can pass information to a web server using the HTTP request blocks, though. Then the web server could send an email.

brantsmith

  • Posts: 151
Could you explain how I would do that. Or where I could find out about it.
Coding is Awesome.
Stencyl is Better.

Joe

  • *
  • Posts: 2480
If you're not familiar with web servers and programming, it's really not something I'd recommend taking on.

If you do have programming experience or are feeling particularly adventurous, you could sign up for a free Google App Engine account. They have fairly straightforward mail APIs for Python and Java.

brantsmith

  • Posts: 151
Thanks for the help. I actually have experience in programming but not in web servers. Although that has been something I have been interested in.
Coding is Awesome.
Stencyl is Better.

Joe

  • *
  • Posts: 2480
No problem. There are other ways of going about it, too. You can use Google Sites -- again, free -- along with Google Apps Script to send mail, or lots of PHP hosts will let you do the same.

Let us know how it ends up going. :)

brantsmith

  • Posts: 151
Quick question. Once I have the server set up, What do I put inside the *visit URL* block, so that it would pass info. thanks
Coding is Awesome.
Stencyl is Better.

Joe

  • *
  • Posts: 2480
You'll have to pass your information as GET parameters. For example, if you've created a PHP page, the URL you'll want to make a request to might look something like this:

http://myserver.com/send_email.php?PlayerName=brantsmith&Score=5000

You can build up that string by using the text blocks. (Make sure the string doesn't have any weird characters in it, or else it'll probably have to be URL-encoded first.) Then "PlayerName" and "Score" will be available via $_GET["PlayerName"] and $_GET["Score"] inside the PHP script.

brantsmith

  • Posts: 151
You know, When I was trying to do this, I found out that it was a little over my head. I have expertise in other things. I thought I would try. How would you submit information to an online text file? If you have ever heard of scratch by MIT. There was an edit that someone did, and in the edit it had a block that said.* Write (text) to http://(link to file online)* Is there anyway i could do this?
Coding is Awesome.
Stencyl is Better.