Skip to content

Instantly share code, notes, and snippets.

@ngangavic
Created January 31, 2020 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ngangavic/e793d2ccf5157f999d38c27bb016c9c1 to your computer and use it in GitHub Desktop.
Save ngangavic/e793d2ccf5157f999d38c27bb016c9c1 to your computer and use it in GitHub Desktop.
<?php
if(isset($_POST['name'])&&isset($_POST['email'])&&isset($_POST['message'])){
$name = $_POST["name"];
$email = $_POST["email"];
$message = $_POST["message"];
$to = "youremail@email.com";
$subject = "Message From $name";
$headers = "From: $name ".$email;
mail($to,$subject,$message,$headers);
}else{
echo 'Error';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment