Posted 25 May 2015 - 06:51 AM
Mmk. I did it. For any of you guys who want to know how, here are my scripts.
ComputerCraft Scriptclear print ("Enter A Message") local input = read() http.post( "http://example.com/page.php?message="..textutils.urlEncode(tostring(input)) )
WebPage PHP<?php $message = urldecode($_GET['message']); mail("EMAIL", "SUBJECT", "$message" ); ?>
This will send an email with the message you put on the computercraft program. Predefine an email and subject, or adapt the program to include an input for the CC program.
Thanks so much for this, it is exactly what I'm looking for. I don't have access to Computer Craft at work so I'm trying out the lua script on Lua 5.1 for Windows. When I run the lua script I get this error message: '=' expected near 'print'. Any ideas what is wrong?
My ultimate goal is to have a switch in Minecraft that when flicked, sends an email that will trigger a Belkin Wemo switch via IFTTT.
(I realise this is an old thread, hope someone can help).