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("[email protected]");
$mail->AddAddress("##########@vtext.com");
$mail->AddAddress("[email protected]");
$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:
$mail->AddCC("[email protected]");
Also, are you sure that your SMTP server is not blocked by Gmail? have you tried any other email address?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With