简体   繁体   中英

From header php mail() send sms to phone number

I really want to change the from parameter to absolutely anything I want, when sending sms with php's mail() function. eg 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" . "\r\n";
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.

您需要在邮件中添加-f标志以覆盖发件人,但我警告您,这样做会导致X-Authentication-Warning: hostname: www-data set sender to info@example.com using -f标头X-Authentication-Warning: hostname: www-data set sender to info@example.com using -f在接收端,除非您的/etc/mail/trusted-users允许使用此主机,否则您就无法控制是否在共享主机上。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM