PHP mail() issue

Seems like you are trying to make use of additional parameters.

Exerpt from PHP Manual

The additional_parameters parameter can be used to pass an additional
parameter to the program configured to use when sending mail using the

mail('[email protected]', 'the subject', 'the message', null, '[email protected]');

Route : 2

Try something like this.

Your $from is contained in the $headers variable itself , so you don’t have to specify.

    $to      = '[email protected]';
    $subject="the subject";
    $headers="From: [email protected]" . "\r\n" .
        'Reply-To: [email protected]' . "\r\n" .
        'X-Mailer: PHP/' . phpversion();

   if(mail($to, $subject, $message, $headers))
    { #And finally send them a thanks
   header('Location: thanks.html.php');
   } else {
   echo 'Email did not send';

Browse More Popular Posts

Leave a Comment