Home Forums Plugins Offline Credit Card Processing Support Empty Emails Reply To: Empty Emails

#6863
epschmidt
Participant

bigmountain,

I added some email validation to my sendmail.php file to prevent the sending of blank emails. I believe the problem was bots hitting the page and trying to send the form. Anyway, here’s what i used…

if(trim($_POST['mail']) == '')  {
		$hasError = true;
	} else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+.[A-Z]{2,4}$", trim($_POST['mail']))) {
		$hasError = true;
	} else {
		$mail = trim($_POST['email']);
	}

if(!isset($hasError)) {
	mail( $to,$subject,$message,$headers);

}

This way the CC email will not send unless the user enters an actual email address. This has stopped us getting totally blank CC emails from the plugin. I still also have the occasional problem of no CC email being sent on a successful order. I’m hoping the updated plugin will take care of this.