I wrote a php script to do this but it always echos the hosting account name + server address as the sender. Anyone know how to fix that?
Other than that it works great. Not all sms gateways are implemented but they are easy to add. The teleflip default NEVER works so if you don't specify the correct carrier you are SOL. It is easy to lookup the carrier based on the area code and prefix though
<?php
if ($_POST['target']!=""){
$from_name=$_POST['from_name'];
$provider=$_POST['provider'];
$target=$_POST['target'];
$subject=$_POST['subject'];
$message=$_POST['message'];
switch ($provider) {
case "alltel":
$target2="@message.alltel.com";
break;
case "att":
$target2="@mmode.com";
break;
case "boost":
$target2="@myboostmobile.com";
break;
case "cingular":
$target2="@mobile.mycingular.com";
break;
case "nextel":
$target2="@messaging.nextel.com";
break;
case "sprint":
$target2="@messaging.sprintpcs.com";
break;
case "tmobile":
$target2="@tmomail.net";
break;
case "verizon":
$target2="@vtext.com";
break;
case "virgin":
$target2="@vmobl.com";
break;
default:
$target2="@teleflip.com";
}
$target .=$target2;
$eol="\r\n";
$headers = "From:".$from_name."<".$from_name."@yourdomain.com>".$eol;
$headers .= "Reply-To:".$from_name."<".$from_name."@yourdomain.com>".$eol;
$headers .= "Return-Path:".$from_name."<".$from_name."@yourdomain.com>".$eol;
$message2 = stripslashes($message);
$message2 .=" - yourdomain.com";
$mime_boundary=md5(time());
$headers .= "Message-ID: <".time()."-".$from_name.">".$eol;
$headers .= "X-Mailer: PHP v".phpversion().$eol;
if(mail($target,$subject,$message2,$headers)) {
echo('<p>Your sms was sent!</p>');
} else {
echo('<p>Message delivery failed</p>');
}
}
echo '
<form action="" method="post">
Sender Details<br>
<b>Name:</b><br>
<input name="from_name" type="text" value="" size="10">
<br>
Recipient Details<br>
<b>Recipient 10 digit number:</b><br>
<input name="target" type="text" size="10">
<br>
<b>Recipient service provider:</b><br>
<select name="provider">
<option value="alltel">Alltel</option>
<option value="att">AT&T Wireless</option>
<option value="boost">Boost Mobile</option>
<option value="cingular">Cingular</option>
<option value="nextel">Nextel</option>
<option value="sprint">Sprint PCS</option>
<option value="tmobile">T-Mobile</option>
<option value="verizon">Verizon</option>
<option value="virgin">Virgin Mobile</option>
</select>
<br>
<b>Subject:</b><br>
<input name="subject" type="text" value="" size="20">
<br>
<b>Message:</b><br>
<textarea name="message" cols="20" rows="3"></textarea>
<input type=submit action="'.$_SERVER['PHP_SELF'].'">
</form>
';
?>