reply-to address in php contact form

后端 未结 2 1097
没有蜡笔的小新
没有蜡笔的小新 2020-12-03 17:54

I bought a simple website template with a php contact form. Everything works great with the one small exception of actually receiving the messages sent via the form. That is

2条回答
  •  感情败类
    2020-12-03 18:53

    Try changing this part of your code :

    $subject = "Contact Form: $name";
    $message = "$message";
    $headers = 'From: myemail@my_domain.com' . "\r\n" .
        'Reply-To: $email' . "\r\n" .
        'X-Mailer: PHP/' . phpversion();
    

    To this :

    $subject = "Contact Form: $name";
    $message = "$message";
    $headers = 'From: myemail@my_domain.com' . "\r\n" .
        'Reply-To: ' . $email . "\r\n" .
        'X-Mailer: PHP/' . phpversion();
    

    Basically take out the $email from inside the single quote and append it to that string

提交回复
热议问题