email 的傳遞有點像現實生活種的郵差先生在寄信
分為信封寄件者和信紙寄件者
envelope-from 顧名思義,就是寫在信封或是包裹上面的寄件者
所以是給郵差和MTA 看的

信紙寄件者,通常就是我們常看到信件的最下面寫著 XXX 敬上 .. 之類的稱呼
是給收件者看的,通常outlook 及其他MUA顯示的是這個欄位

php mail() 
bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
通常我們都會把From: 寫在第四個變數
但是這只是修改信紙寄件者
郵差先生看到的寄件者還是系統自動幫你帶的,不一定會跟From 會一樣
往往這樣可能會造成一些退信的狀況

建議From: 和 envelope from 都可以改成一致
避免不必要的困擾

example:
<?php
mail('ethan@a.com','Hello World!','Good morning!','From: service@b.com','-f service@b.com');
?>

undefined
PHP、MySQL與JavaScript學習手冊(第五版)
Learning PHP, MySQL & JavaScript, 5th Edition

作者: Robin Nixon  
譯者: 賴屹民
出版社:歐萊禮 

arrow
arrow
    文章標籤
    php mail
    全站熱搜

    helloworld 發表在 痞客邦 留言(0) 人氣()