I'm using the wp_mail function to send emails in WordPress. Before I run the function, I retrieve a heap of data from a session and some others from a form that was just submitted. For example:
$first_name = $_SESSION['first_name']; $last_name = $_SESSION['last_name']; $phone_number = $_POST['phone_number']; $message = $first_name . $last_name . $phone_number; wp_mail($myemail,"Email sent",$message);
I'm using the plugin called WP-MAIL SMTP to send via Gmail's SMTP servers. When I disable this, no emails are sent at all.
For some reason, I receive two emails. One has the POST AND SESSION information and the other only has the SESSION information.
Any help would be greatly appreciated! Thanks in advance,
I'm using WordPress 3.3