mail()
関数経由でメールを送信したい。
mail($to,$subject,$message)
正常に動作します。
しかし、使用mail($to,$subject,$message,$header)
してもうまくいきません。ヘッダーは次のとおりです。
Date: Tue, 2 Jul 2013 15:01:49 +0200 +0200
Return-Path: noreply@myhost.com
From: "noreply@myhost.com"
Message-ID:
X-Priority: 3
X-Mailer: PHPMailer 5.2.4 (http://code.google.com/a/apache-extras.org/p/phpmailer/)
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/html; charset=UTF-8
ヘッダーの何が問題になっていますか? 参考までに、ヘッダーは PHPMailer によって生成されます。送信に使用するコードは次のとおりです。
$mail = new PHPMailer();
$mail->IsMail();
$mail->From = $from;
$mail->FromName = $from;
$mail->AddAddress($to);
$mail->IsHTML(true);
$mail->CharSet = 'UTF-8';
$mail->Subject = $subject;
$mail->Body = $message;
$mail->Send();