Posts Tagged ‘headers’

Using the PHP Mail Function with Additional Headers

Posted 07 Feb 2010 — by admin
Category php

Pass a fourth parameter to the mail() function with the header information.

<?php
$to = "jane@example.com";
$subject = "Hello World!";
$body = "This will be sent from email-addr@example.com";
$headers = "From: email-addr@example.com\r\nX-Mailer: php";
mail($to, $subject, $body, $headers);