Complete mail header

后端 未结 6 1901
闹比i
闹比i 2020-11-27 15:14

I need a set of mail headers to attach to my mail() function in PHP. I send emails with HTML in them, and sometimes services like Yahoo Mail block them. Therefo

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-27 15:30

        $headers  = "From: testsite < mail@testsite.com >\n";
        $headers .= "Cc: testsite < mail@testsite.com >\n"; 
        $headers .= "X-Sender: testsite < mail@testsite.com >\n";
        $headers .= 'X-Mailer: PHP/' . phpversion();
        $headers .= "X-Priority: 1\n"; // Urgent message!
        $headers .= "Return-Path: mail@testsite.com\n"; // Return path for errors
        $headers .= "MIME-Version: 1.0\r\n";
        $headers .= "Content-Type: text/html; charset=iso-8859-1\n";
    

提交回复
热议问题