I’m a beginner at PHP but I had to make a contact form for a website.
Here is my PHP
[php]
<?php $name = $_POST['name']; $email = $_POST['email']; $text = $_POST['text'] $from = "From: Website "; $to = '[email protected]'; $subject = 'Message'; $body = "From: $name\n Email: $email\n Message:\n $text"; ?> <?php if ($_POST['submit']) { if (mail ($to, $subject, $body, $from)) { echo 'Your message has been sent!
'; } else { echo 'Something went wrong, go back and try again!
'; } } [/php] Here is the HTML [code]