I am writing a small web app that uses PHP code to email a phone number (the person with the phone number sees it as a text message, and not as an email of course). Every phone service has email to text. For example, Verizon in the US uses @vtext.com.
My problem is this, the FROM on the SMS always says “6245” which is apparently standard for SMS’s from the Verizon email domain (vtext.com). Can I change this in code with a more human readable From rather than this seemingly random number?
Here is my code using PHP mailer:
$from = $_POST['email'];
$from = filter_var($from, FILTER_SANITIZE_EMAIL);
$message .= $guest . ' waiting at Office. Checked in at ';
$message .= strftime("%l:%M %p (%A %b %e, %Y)", time());
// PHP SMTP mail version
$mail = new PHPMailer();
$result = mysql_query("SELECT * FROM users WHERE onduty = 1");
$recipients = array();
while ($row = mysql_fetch_array($result)) {
$recipients[] = $row['phone'] . $row['carrier'];
}
foreach ($recipients as $email) {
$mail -> AddAddress($email);
}
$from_name = "Riverstone Notification";
$subject = "Person in Office";
$mail -> IsSMTP();
$mail -> Host = "relay-hosting.secureserver.net";
$mail -> Port = 25;
$mail -> SMTPAuth = false;
$mail -> Username = "EMAIL_USER";
$mail -> Password = "EMAIL_PASS";
$mail -> FromName = $from_name;
$mail -> From = $from;
$mail -> Subject = $subject;
$mail -> Body = $message;
$result = $mail -> Send();
No, when you’re using the Verizon’s service, that no. is going to be standard, because it comes from Verizon’s SMS gateway.
You would have to get a paid service, if you need flexibility on that.