从标题php mail()发送短信到电话号码

I really want to change the from parameter to absolutely anything I want, when sending sms with php's mail() function. e.g the user sees text message from "the developer" on their phone screen. I don't want the @domain From response, nor the email address.

$headers = "From: " . "the developer" . "
";
mail('#@domain', 'check', $client, $headers);`

As far as I have seen, headers are stripped / replaced by the SMS gateway with headers they prepare. So altering the FROM parameter on your end will have no effect. The only option would be to look at renting a short code number or using a price-based SMS gateway provider. I'm assuming this measure is in effect to prevent malicious intent.

You need to add a -f flag to mail in order to override the sender, but I warn you that doing so will cause an X-Authentication-Warning: hostname: www-data set sender to info@example.com using -f header on the receiving end unless this host is allowed in your /etc/mail/trusted-users which you may not have control of if you're on shared hosting.