Last active
January 10, 2019 00:24
-
-
Save thiagolopes-dev/381a59f54ea02d63137d232611b359b3 to your computer and use it in GitHub Desktop.
mail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$to = "contato@lupustech.com.br"; // replace this mail with yours | |
$from = $_POST["email"]; | |
$email = $_POST["email"]; | |
$fname = utf8_decode($_POST['fname']); | |
$lname = utf8_decode($_POST['lname']); | |
$headers = "From: $from"; | |
$message = utf8_decode($_POST['message']); | |
$body = "Contato Site \n"; | |
$body .= " \n\n\t Name: ".$fname." ".$lname; | |
$body .= " \n\n\t Email: ".$email; | |
$body .= " \n\n\t Message: ".$message; | |
if ( mail( $to, $subject, $body, $headers ) ) { | |
echo '<label class="success">Enviado ! <b>e-mail.</b></label>'; | |
} else { | |
echo '<label class="error">Algo deu errado! Por favor, tente novamente.</label>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment