[PHP][Showoff]Text Sender

Joined
Nov 6, 2007
Messages
880
Reaction score
11
Ok so i was kinda bored so i made a text sender :D
http://radiodev.org/ringtone
It sends texts to phones :D
PHP:
<?php
$number = $_POST['number'];
$email_to = "$number@$provider";

if ($_POST['provider'] == "Tmobile") {
$provider = "tmomail.net";
}
if ($_POST['provider'] == "Telstra") {
$provider = "mobilenet.telstra.net";
}
if ($_POST['provider'] == "Bell Canada") {
$provider = "txt.bell.ca";
}
if ($_POST['provider'] == "AT&T/Cingular") {
$provider = "txt.att.net";
}
if ($_POST['provider'] == "Boost Mobile") {
$provider = "myboostmobile.com";
}
if ($_POST['provider'] == "Nextel") {
$provider = "messaging.nextel.com";
}
if ($_POST['provider'] == "Sprint") {
$provider = "messaging.sprintpcs.com";
}
if ($_POST['provider'] == "Verizon") {
$provider = "vmobl.com";
}
$email_to = "$number@$provider";
$email_subject = $_POST['subject'];
$email_body = $_POST['message'];

if(isset($_POST['submit']))
{
	if(mail($email_to, $email_subject, $email_body)){
   	 echo "the email $email_subject was sent";
	} else {
    	echo "The email $email_subject was NOT sent.";
	}
} else {
?>
<html><body>
<form method="post"> 
<select name="provider"> 
<option>Tmobile</option>
<option>Bell Canada</option>
<option>AT&T/Cingular</option>
<option>Boost Mobile</option>
<option>Nextel</option>
<option>Sprint</option>
<option>Verizon</option>
<option>Telstra</option>
</select>
<br />
Phone Number: <input name="number" type="text" /> 
<br />
Subject: <input name="subject" type="text" /> 
<br />
<textarea rows="5" cols="20" wrap="physical" name="message">
Message Here
</textarea>
<br />
<input type="submit" name="submit" />
</form>
</body></html>
<?php
}
?>
Dont rip please :D
 
Greatjob, although i'm with Optus AU. So it's pretty useless for me.
I've always wondered how these work, do they send the headers and other information through the Telsta Satelite or what:ehh:?
 
I was under the impression you needed a telecom server of some sort to do this(?).
But if this does the job then awesome I learned something... *goes to try it*
My thanks if it works lol

--Edit--
it looks as though your provider must support the email/sms system for this email script to work.
Yes only major carriers provide this perk. Oh well still handy to know thanks.
 
If you made all the providers except the first inside else if()'s then it would be a little better because it would stop looking through the if statements for the other providers after it found one..
You could also do a switch case method to be more efficient ;)
 
If you made all the providers except the first inside else if()'s then it would be a little better because it would stop looking through the if statements for the other providers after it found one..
You could also do a switch case method to be more efficient ;)
i was thinking about the doing an else if but i decided not to for reasons unkown.
 
Back