Streaming live at 10am (PST)

[Tutorial] PHP Contact Form (External Hosting)


#1

If you do not want to use the webflow forms you can use PHP, its free :slight_smile:

This is the form that you must attach to your index.html in the section

<form action="mail.php" method="POST">
<p>Name</p> <input type="text" name="name">
<p>Email</p> <input type="text" name="email">
<p>Message</p><textarea name="message" rows="6" cols="25"></textarea><br />
<input type="submit" value="Send"><input type="reset" value="Clear">
</form>

Now, you must create a php file with the name “mail.php” in the root (folder that you have index.html)

<?php $name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="From: $name \n Message: $message";
$recipient = "emailaddress@here.com";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!";
?>

Change: recipient: emailaddress@here.com and write your email… READY!
(You can change “thank you” por another html page (copy&paste) you make for a success form sent.)