0

次のコード行があります。

        $from = "email@domian.com";
        $headers = "From:" . $from;
        $headers .= "MIME-Version: 1.0\r\n";
        $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

htmlファイルにfile_get_contentsを使用しているため、MIMEタイプが必要です。問題は、「email@domain.comMIME-Version:1.0」と表示されるヘッダーの下にあり、「email@domain.com」とだけ言いたいのですが、ヘッダーに表示されているから、のMIMEタイプを削除しますか?

ありがとう

4

2 に答える 2

7

ヘッダー\r\nの後に追加するだけです。From:

$headers = "From:" . $from . "\r\n";
于 2012-04-20T18:53:16.110 に答える
0
$to = "whereyousendmail@gmail.com";
$from = "email@domian.com";
$subject = "New Agent Record";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= "Reply-To: New Agent Record <email@domian.com>\r\n"; 
$headers .= "Return-Path:New Agent Record <email@domian.com>\r\n";
$headers .= "From: New Agent Record <email@domian.com>\r\n";
$headers .= "Organization: Your Email Subject\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-Mailer: PHP". phpversion() ."\r\n";
于 2020-01-03T06:37:10.847 に答える