I am trying to send SMS using php’s mail() function. Below you will find my code. I entered my own email address and my own phone number (it is a Verizon phone so sending an email to my 10 digit number followed by @vtext.com should send the SMS to my phone). I receive the email but not the text message.
#!/usr/bin/php
<?
require_once("PHPMailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtp.fas.harvard.edu";
$mail->SetFrom("example@gmail.com");
$mail->AddAddress("##########@vtext.com");
$mail->AddAddress("example@gmail.com");
$mail->Subject = "hello, world";
$mail->Body = "testing 1 2 3";
if ($mail->Send() === false)
die($mail->ErrorInfo . "\n");
?>
Why don’t you use the emails in another way, like:
Also, are you sure that your SMTP server is not blocked by Gmail? have you tried any other email address?