Form data successfully inserted into database."; } elseif ( $submit == "Submit Form To Email" ) { // Build Email Message from Form values $email_message = $email."\n".$account."\n".$date."\n".$program."\n".$others."\n".$othersfolder."\n".$submit; // Get the date for stamping the email $strdate = date("D, d M Y H:i:s",time()); // Send the email $retval = mail("tanjiankai@hotmail.com", "Survey Submission", $email_message, "From: tanjiankai@hotmail.com\nReply-To: tanjiankai@hotmail.com\nDate: ".$strdate."\nX-Mailer: PHP/"); // Check if the email sending was successful if( $retval ) { echo "
Form data successfully emailed."; } else { echo "
Error sending form data by email! Please contact youremail@yourdomain.com."; } } print "
Go back to the Outline."; ?>