Fortunately, AT&T does provide email-based texting (1234567890@txt.att.net). So, I taught myself some PHP, built a small Web interface to the PHP email function, and, voila, her work can now text to her. All in under an hour of time.
The script is appended. The HTML-based UI should be obvious. Comments are appreciated.
<?php
$phone = $_GET['phone'];
if (!$phone)
{
echo 'No phone number specified.';
exit(1);
}
$to = "$phone@txt.att.net";
$subject = $_GET['subject'];
$body = $_GET['body'];
if (!$body)
{
echo 'No body specified.';
exit (1);
}
$headers = "From: $to";
$mail_sent = @mail( $to, $subject, $body, $headers );
echo $mail_sent ? "Message sent" : "Message failed";
?>
No comments:
Post a Comment