Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mail() - emails work but SMS doesn't

Tags:

php

email

sms

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");  

?>
like image 221
user1084785 Avatar asked Dec 31 '25 05:12

user1084785


1 Answers

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?

like image 117
camilo_u Avatar answered Jan 02 '26 18:01

camilo_u



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!