作者ptthuey (天秤守望者)
看板PHP
標題[請益] 有關php寄信的header問題
時間Sat Apr 29 15:26:44 2006
最近在測試php的寄信功能,我是用gmail來收信,可是收到信之後的寄件者
變成了'system user for apache',且電子信箱也變成了該SMTP,
不知道header的寫法是不是有問題
這樣的寫法會跑出上述的結果,且完全看不到To:、From:的資訊
$headers='To:$encodeTo_name<$to_mail>\r\n'
'From:$encodeFrom_name<$from_mail>\r\n' .
'MIME-Version:1.0\r\n' .
'Content-Transfer-Encoding: 8bit\r\n' .
'Content-type:text/plain; charset=UTF-8\r\n';
把'換成"的寫法會變成unknown sender
$headers="To:$encodeTo_name<$to_mail>\r\n" .
"From:$encodeFrom_name<$from_mail>\r\n" .
"MIME-Version:1.0\r\n" .
"Content-Transfer-Encoding: 8bit\r\n" .
"Content-type:text/plain; charset=UTF-8\r\n";
--
. . . . .
. . / . . .
. . /
.
. . / . . .
Widerstand ist zwecklos!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.119.29.12
1F:推 litthe:改這樣看看"To: $encodeTo_name < $to_mail >\r\n" 04/29 18:14
2F:→ litthe:變數前後加個空格 04/29 18:15