3v4l.org

run code in 300+ PHP versions simultaneously
<?php // EDIT THE 2 LINES BELOW AS D $email_to = "abc18712@gmail.com"; $email_subject = "Hi from John 2"; $email_from = "Jon Lottern <john@rgwtgtwhgt.com>"; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message = "Hi there\n\n"; $email_message .= "Thought about this\n"; $email_message .= "Cheers\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); print "sent";

preferences:
32.63 ms | 402 KiB | 5 Q