This is a new questions, that I figured deserved a new thread.
I have a php for that is sending an SMS to the mobileNumber@carrier.com
This is working.
I have to ask the user to input his number and to choose his provider, I was wondering since in my area NEW YORK, we only have about 7 popular mobile providers.
Can I skip that second question of asking the user what mobile provider.
And then just send with php all 7 emails out with the number and each mobile carriers email extention to wind up with hitting one of them?
for instance, instead of sending
mail(1231233321@txt.att.net, $subject, $message );
can I send all 7 at once? Knowing 6 wont work..
mail(1231231233@txt.att.net, 1231231233@tmobile.net, etc....., $subject, $message );
And if so How would I go about writing it with this attached code?
<?php
if (!isset($_POST['submit'])){error("Must use form to get here!");}
$ph = preg_replace('/[^[:digit:]]/', '', $_POST['10digit']);
$carrier = $_POST['carrier'];
switch ($carrier){
case 'att':
$to = $ph . '@txt.att.net';
break;
case 'metropcs':
$to = $ph . '@mymetropcs.com';
break;
case 'nextel':
$to = $ph . '@messaging.nextel.com';
break;
case 'sprint':
$to = $ph . '@messaging.sprintpcs.com';
break;
case 'tmobile':
$to = $ph . '@tmomail.net';
break;
case 'verizon':
$to = $ph . '@vtext.com';
break;
case 'virgin':
$to = $ph . '@vmobl.com';
break;
default:
error("No carrier selected, message not sent!");
}
$subject = "Buseto's Pizzeria";
$message = "1851 Sunrise Highway, Bay Shore, NY 11706 (631) 665-4939 http://www.busetopizza.com";
mail($to, $subject, $message);
echo "Your message has been sent!";
exit();
function error($msg){
echo "An error has occurred: ".$msg;
exit();
}
?>
SPAM emails are the primary reason the internet is not as fast as it could be. Do you really want to be contributing 6 times the amount of emails you should send just to remove the need for one little drop-down?
To answer the question, multiple recipients can be specified by separating them correctly, which if memory serves is done with a semicolon. So your
toparameter will look like"test@example.com;other@example2.com".