• 1.
    <?php
  • 2.
     
  • 3.
    $myName    = 'Lebensform'; // your full name
  • 4.
    $myEmail   = 'hello@lebensform.me'; // your e-mail address
  • 5.
     
  • 6.
    if (isset($_POST['name']) && isset($_POST['email']) && isset($_POST['message'])) {
  • 7.
     
  • 8.
    	$userName  = $_POST['name'];
  • 9.
    	$userEmail = $_POST['email'];
  • 10.
    	$subject   = 'Message from ' . $_SERVER['SERVER_NAME'];
  • 11.
    	$message   = $_POST['message'] . "\r\n\r\n--------------------------------\r\nSent from " . $_SERVER['SERVER_NAME'];
  • 12.
    	$headers   = 'From: '. $myName .' <'. $myEmail .'>' . "\r\n" .
  • 13.
    	    'Reply-To: '. $userName .' <'. $userEmail .'>' . "\r\n" .
  • 14.
    	    'X-Mailer: PHP/' . phpversion();
  • 15.
    	
  • 16.
    	if (!mail($myEmail, $subject, $message, $headers)) {
  • 17.
    		echo 'Message could not be sent.';
  • 18.
    		exit;
  • 19.
    	}
  • 20.
    	
  • 21.
    	echo 'success';
  • 22.
     
  • 23.
    }
  • 24.
     
  • 25.
    ?>
<?php $myName = 'Lebensform'; // your full name $myEmail = 'hello@lebensform.me'; // your e-mail address if (isset($_POST['name']) && isset($_POST['email']) && isset($_POST['message'])) { $userName = $_POST['name']; $userEmail = $_POST['email']; $subject = 'Message from ' . $_SERVER['SERVER_NAME']; $message = $_POST['message'] . "\r\n\r\n--------------------------------\r\nSent from " . $_SERVER['SERVER_NAME']; $headers = 'From: '. $myName .' <'. $myEmail .'>' . "\r\n" . 'Reply-To: '. $userName .' <'. $userEmail .'>' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); if (!mail($myEmail, $subject, $message, $headers)) { echo 'Message could not be sent.'; exit; } echo 'success'; } ?>

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter