[英]Send SMS to phone - php form removing ( ) and - from the phone number submitted
[英]From header php mail() send sms to phone number
當使用php的mail()
函數發送短信時,我真的想將參數從絕對更改為我想要的任何內容。 例如,用戶在其手機屏幕上看到text message from "the developer"
的短信。 我既不需要@domain
發件人回復,也不需要電子郵件地址。
$headers = "From: " . "the developer" . "\r\n";
mail('#@domain', 'check', $client, $headers);`
據我所知,標頭被SMS網關剝離/替換為它們准備的標頭。 因此,最終更改FROM參數將無效。 唯一的選擇是查看短代碼號碼或使用基於價格的SMS網關提供商。 我假設此措施實際上是在防止惡意意圖。
您需要在郵件中添加-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
允許使用此主機,否則您就無法控制是否在共享主機上。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.