You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PHP向Verizon手机号发送短信显示成功但未收到问题

Hey there, let's work through why your Verizon SMS isn't showing up even though your PHP script says "sent"!

Troubleshooting Your Verizon SMS Delivery Issue

First, I spotted a tiny but critical typo in your code snippet:

  • You forgot the dollar sign $ for the subject variable! It should be $subject = 'the subject'; — even if this was just a typo when sharing your code, fixing that is the first quick check to rule out syntax issues.

Now, it’s important to remember: the mail() function returning true only means your server accepted the message for delivery — it doesn’t guarantee it reached the recipient’s phone. Here are the most likely fixes for your problem:

1. Fix the Mail Function’s Lack of Authentication

PHP’s native mail() function uses your server’s default sendmail setup, which often isn’t authenticated with your Gmail address. Verizon’s vtext.com gateway is strict about unauthenticated messages and may flag them as spam or reject them entirely.

Instead, use a library like PHPMailer that handles SMTP authentication properly. Here’s a working example tailored to Verizon’s gateway:

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;

require 'vendor/autoload.php';

$mail = new PHPMailer(true);

try {
    // Gmail SMTP settings
    $mail->isSMTP();
    $mail->Host = 'smtp.gmail.com';
    $mail->SMTPAuth = true;
    $mail->Username = 'mymail@gmail.com';
    $mail->Password = 'your-app-specific-password'; // Use a Gmail app password (enable 2FA first!)
    $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
    $mail->Port = 465;

    // Recipient & Sender
    $mail->setFrom('mymail@gmail.com', 'Your Name');
    $mail->addAddress('281818888@vtext.com'); // Verizon SMS gateway address

    // SMS-friendly content
    $mail->isHTML(false); // Stick to plain text for SMS
    $mail->Subject = 'the subject';
    $mail->Body = 'hello';

    $mail->send();
    echo 'sent';
} catch (Exception $e) {
    echo "Message failed: {$mail->ErrorInfo}";
}

Pro tip: For Gmail, enable 2-factor authentication first, then create an app-specific password — this is more secure than allowing "less secure apps".

2. Verify the Verizon Gateway Address

While vtext.com is the standard SMS gateway, some Verizon accounts might respond better to vzwpix.com (originally for MMS, but works for SMS too). Try switching your recipient to 281818888@vzwpix.com to test.

3. Check Your Server’s Mail Logs

Your server’s mail logs (usually found at /var/log/mail.log or similar) will show exactly what happened to the message. Look for entries with your Verizon recipient address — you might see error codes like 550 (rejected as spam) or 554 (content policy violation) that point to the root issue.

4. Test with a Direct Email

Send a test email to 281818888@vtext.com directly from your Gmail account (not via PHP). If this works, the problem is definitely with your PHP mail setup. If it doesn’t, double-check the phone number is correct, or contact Verizon to confirm their gateway isn’t blocked for that number.


内容的提问来源于stack exchange,提问作者casillas

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 08:17:57