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: my@email.com\n";
mail($to,$subject,$body,$headers);
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: my@email.com\n";
mail($to,$subject,$body,$headers);
Try a simple structure (source: PHP.net - mail())
<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
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: my@email.com\n";
so you get:
$headers.= "Reply-To: my@email.com\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)