Link to home
Start Free TrialLog in
Avatar of JohnMac328
JohnMac328Flag for United States of America

asked on

PHP error check before trying to send emails

Dealing with a live site and don't want to blow up the page - will this cause any problems anyone can see

			// Send emails to individuals
		if (isset($_POST['id-01'])) {
			$to = 'email@somewhere.com';
		}
		elseif (isset($_POST['id-02'])) {
			$to = 'email@somewhere.com';
		}
		elseif (isset($_POST['id-03'])) {
			$to = 'email@somewhere.com';
		}
		elseif (isset($_POST['id-04'])) {
			$to = 'email@somewhere.com';
			
		$send_data = array(
			'to' => $contact_form['Mail_To'] ? $contact_form['Mail_To'] : $this->default_contact_email,
			'from' => $contact_form['Mail_From'] ? $contact_form['Mail_From'] : $this->default_email_from_address,
			'subject' => "{$contact_form['Subject']} from $this->End_User_URL",
			'body' => $contact_form['Body']
			);
		}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Swatantra Bhargava
Swatantra Bhargava
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JohnMac328

ASKER

Thanks