Skip to content

Instantly share code, notes, and snippets.

@thiagolopes-dev
Last active January 10, 2019 00:24
Show Gist options
  • Save thiagolopes-dev/381a59f54ea02d63137d232611b359b3 to your computer and use it in GitHub Desktop.
Save thiagolopes-dev/381a59f54ea02d63137d232611b359b3 to your computer and use it in GitHub Desktop.
mail
<?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