All pastes #110630 Raw Edit

Anonymous

public php v1 · immutable
·published 2006-08-01 20:16 UTC
rendered paste body
<?phpfunction is_email_type($email) {	$email_types = array('gmail', 'yahoo', 'hotmail');	foreach ($email_types as $type) 	{	    if (strpos($email, '@'.$type) !== false)	        return true	}	return false;}if($_POST['button']){	if($_POST['subject'] && $_POST['message'])	{		if(is_email_type($_POST['email']))		{			$email = $_POST['email'];			$toemail = "antonnid@gmail.com";			$subject = $_POST['subject'];			$message = $_POST['message'];			if(mail($toemail, $subject, $message, "From: $email"))				echo "Your message has been sent. I will reply as soon as i can i apreaciate your suggestions.";			else				echo "Error sending email!";		}		else			echo "Invalid Email!";	}	else		echo "One or more of the required fields was not filled out!";}?>