Pradeep Jaiswar
Pradeep Jaiswar

Reputation: 1805

PHP : Add reply-to text to the mail when someone replies to mail

I am sending mail to customer with reply to email-id , when customer click reply to , a predefined text should be added to contain body and customer will type contain after that. How this can be done ?

Upvotes: 0

Views: 154

Answers (1)

Siraj Khan
Siraj Khan

Reputation: 2348

you need to set the headers to be able to pass the sender email:

<?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);
?>

Upvotes: 1

Related Questions