0

I want to replace default webmaster email from my email it's not working in php script.
I have tried reply-to but it's not working This is my php code.

$headers= "Reply-To: [email protected]\n";

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

2 Answers2

1

Try a simple structure (source: PHP.net - mail())

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

mail($to, $subject, $message, $headers);
?>
John Priestakos
  • 415
  • 4
  • 19
0

i don't know about your php-version, but mine doesn't like spaces when concatenetating with .=

try to remove the space here:

$headers .= "Reply-To: [email protected]\n";

so you get:

$headers.= "Reply-To: [email protected]\n";

(giving us information about whether you are getting an error-message and if so, which one - would have helped quite a lot, when my suggestion is right)

low_rents
  • 4,481
  • 3
  • 27
  • 55