我使用郵件()發送簡單的郵件。爲了方便起見,我使用標題來設置「發件人」地址。我想知道,我可以把那個地址放在那裏,假裝成任何人;我只是爲了自己的好奇而努力,實際上它很有用!這是正常的嗎?這是使用郵件功能的正確方法?並且有什麼辦法可以識別這些郵件發件人的身份嗎?安全和郵件()函數在php
編輯: 我用mail()的標題中的「from」發送郵件給我的自己,使用我的Gmail地址。我收到這些頭消息:
…
Received: from smarty.dreamhost.com (smarty.dreamhost.com [208.113.175.8]) by mx.google.com with ESMTP id w21si2197938ybh.68.2010.10.19.19.33.30; Tue, 19 Oct 2010 19:33:30 -0700 (PDT)
Received: from nationals.dreamhost.com (nationals.dreamhost.com [69.163.165.6]) by smarty.dreamhost.com (Postfix) with ESMTP id EB56D6E804A for <[email protected]>; Tue, 19 Oct 2010 19:33:29 -0700 (PDT)
Received: by nationals.dreamhost.com (Postfix, from userid 3598506) id E4BB635C83F; Tue, 19 Oct 2010 19:33:29 -0700 (PDT)
Return-Path: <[email protected]>
Received-Spf: pass (google.com: domain of [email protected] designates 208.113.175.8 as permitted sender) client-ip=208.113.175.8;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of [email protected] designates 208.113.175.8 as permitted sender) [email protected]
發生了什麼?我無法解釋標題,但看起來像谷歌接受了假地址!
我不知道具體情況,但如果您嘗試發送電子郵件如果from:標頭與發送服務器的域名不同,gmail會檢測到該地址被欺騙,並將其添加到垃圾郵件文件夾中。 – 2010-10-20 02:21:25
這也適用於真正的郵件! – Frankie 2010-10-20 02:37:21