$to = $to_email;
$subject = 'Event Form Submission';
+
$message = $htmlMessage;
$userBody = $userMessage;
- $headers = 'From:' . $fromEmail . "\r\n" .
- 'Reply-To:' . $contactEmail;
+
$header[] = 'From:' . $fromEmail;
$header[] = 'Reply-To:' . $contactEmail;
wp_mail($to, $subject, $message, $header);
- $userHeader[] = 'From:' . $to[0];
+ // send a copy to the user submitting the email, using different headers and email template file
+ $userHeader[] = 'From: ' . $fromEmail;
$userHeader[] = 'Reply-To: No-Reply@gaslightmedia.com';
-// wp_mail('anthony@localhost', $subject, $userBody, $userHeader);
+ if(wp_mail($adminEmail, $subject, $userBody, $userHeader)){
+
+ } else {
+ echo "Error: Message Not Sent";
+ }
// remove the filter to avoid conflicts
remove_filter( 'wp_mail_content_type', 'set_content_type' );