1
<?php

if(isset($_REQUEST['contactformid']) && $_REQUEST['contactformid'] == 1){


$youremail = "canarycountry@canarycountry.com"; // Enter your email here!!

$usersname = $_POST["usersname"];
$usersemail = $_POST["usersemail"];
$usersphonenumber = $_POST["usersphonenumber"];
$usersmessage = $_POST["usersmessage"];
$subject = "Message From Your Contact Form";
$message = "<p>$usersname has contacted you from your site.</p>
            <h3>Their Message is as follows:</h3>
            <p>$usersmessage</p>
            <h5>Contact details</h5>
            <p>Phone Number: $usersphonenumber</p>
            <p>Email Address: $usersemail</p>"; 

$headers = 'From:' . $usersemail . "\r\n";
mail($youremail, $subject, $message, $headers);

echo "<p>Gracias por su correo electrónico, un miembro de nuestro equipo lo contactará en breve con respecto a su email!</p>";

} else {
    echo "<p>El formulario no podría ser enviado, por favor intente de nuevo!</p>";
}
4

0 回答 0