PHP mb_send_mail()で、エンベロープフロムを設定する

estis2018/12/05 (水) 22:01 に投稿

<?php
$to = "to@example.com";
$subject = "TEST MAIL";
$message = "テスト\r\nヘッダーを見るべし\r\nFrom と envelope_From は別";
$headers = "From: from@example.com";
$headers .= "\n";
$headers .= "Bcc: bcc@kexample.com";
$opt = '-fenvelope_from@example.com';
mb_send_mail($to, $subject, $message, $headers, $opt);

のように、「-f」の引数として指定し、
第5引数として、mb_send_mail関数に渡す。

mail関数でも同様。

Comments