PHP mail () jak ustawić pocztę nadawcy

To jest mój kod:

$to = '[email protected]';

$subject = 'test';

$body = 'test';

$header  = 'MIME-Version: 1.0' . "\r\n";
$header .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$header .= "To: <$to>" . "\r\n";
$header .= 'From: [email protected] \r\n';

mail($to, $subject, $body, $header);

Kod działa, wysyła wiadomość e-mail. Ale nadawca nie jest tym, który zdefiniowałem. Wydaje się, że nadawca jest hostem poczty internetowej. Co ja robię źle?

questionAnswers(1)

yourAnswerToTheQuestion