132 posts
Posted 08 December 2012 - 09:33 AM
Not sure if this is even possible. I wanted to send an actual email (Like to gmail or something) via computercraft. Anyone know if this is possible, and how I would go about doing it?
3790 posts
Location
Lincoln, Nebraska
Posted 08 December 2012 - 09:46 AM
Not that I know of. You would have to use some form of authorization, and ComputerCraft does not have anything built for that. The only thing I think you could do is use some web application that takes an http.post() command, and adds that to an email system already waiting for a message.
236 posts
Location
Germany
Posted 08 December 2012 - 10:02 AM
well google isn't supporting http only access as far as i can see so you would have to create a workaround using tomcat/python or php
1214 posts
Location
The Sammich Kingdom
Posted 08 December 2012 - 11:03 AM
You will have to write a script in PHP that sends a email depending on some args, put it on a webserver, and use http.post to send it data. That is the only way I can think of.
3790 posts
Location
Lincoln, Nebraska
Posted 08 December 2012 - 12:25 PM
Either way you do it, you won't be able to send/receive emails without some sort of go-between; most likely something that you write yourself.
132 posts
Posted 08 December 2012 - 02:42 PM
Mmk. I did it. For any of you guys who want to know how, here are my scripts.
ComputerCraft Script
clear
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.