How do I add the recipients email to the form? Looks at the line in Blue and see that I can manually add and email address. However I need to add the recipients email from the database and this code is from phpMailer.
include("include\PHPMailer\class.phpmailer.php");
include("include\PHPMailer\class.smtp.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = "smtp.myhosting.com";
$mail->Port = 25;
$mail->Username = "wendy@secret.com";
$mail->Password = "secret";
$mail->From = "wendy@secret.com";
$mail->FromName = "wendytest";
$mail->Subject = "wendytest";
$message="";
$message .= "<html>";
$message .= "<div><img src=\"images/phpmailer.gif\"></div>";
$message .= "
This is a test of PHPMailer.
";
$message .= "This particular example uses <strong>HTML</strong>, with a <div> tag and inline";
$message .= "Also note the use of the PHPMailer logo above with no specific code to handle including it.";
$message .= "</html>";
$mail->MsgHTML($message);
$mail->IsHTML(true);
$mail->AddAddress("recipient@email.com");
$mail->AddAddress($values["EMAIL_E"]);
$mail->AddAddress($values["EMAIL_N"]);
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
header("Location: demo3_add.php?a=return");
exit();
}
return true;