Reply directly to sender from form submission emails

Hi there, the ability to setup a reply-to variable, that would hold the users email address, is not yet part of the forms functionality for Forms hosted on webflow.

If you are planning to use the forms to post to an external php mail script that is using PHPmail and your own mail server, then you can set the mail headers to include the From name and reply-to address for the mails getting sent out. You could for example, set the reply-to email address to be taken from the users email address entered on the form…

Some example PHP code that you might use:

<?php

$name = $_POST['name'];
$email = $_POST['email'];  
$subject = $_POST['subject'];
$message = $_POST['message'];
$to = "recipient@your-server.com";
$headers = 'From: '.$email."\r\n" .
        'Reply-To: '.$email."\r\n"
        'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers, "From: " . $name);

header('Location: contact_thankyou.html');

?>

Also, this method could be used, for example, you can setup a drop down list box on your form, containing multiple email addresses, and when user choose the email address they want to send to, you can update the $to variable in the php code to use the value selected in the drop-down list box that is passed in the POST parameter to the PHP script.

This is of course, one option for sending mails via PHP with external php server, but this is a simple method to achieve what you are trying to do… Let me know if you need clarification on something… happy to help ! Cheers!

3 Likes