[請益] 有關php寄信的header問題

看板PHP作者 (天秤守望者)時間19年前 (2006/04/29 15:19), 編輯推噓1(101)
留言2則, 1人參與, 最新討論串1/1
最近在測試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

04/29 18:14, , 1F
改這樣看看"To: $encodeTo_name < $to_mail >\r\n"
04/29 18:14, 1F

04/29 18:15, , 2F
變數前後加個空格
04/29 18:15, 2F
文章代碼(AID): #14KnEJZX (PHP)
文章代碼(AID): #14KnEJZX (PHP)