Use the `email` field to check for form submission, see #3144
This commit is contained in:
parent
ac30223de5
commit
ab8d4f87a4
|
|
@ -10,7 +10,7 @@ use PHPMailer\PHPMailer\PHPMailer;
|
||||||
|
|
||||||
require '../vendor/autoload.php';
|
require '../vendor/autoload.php';
|
||||||
|
|
||||||
if (array_key_exists('to', $_POST)) {
|
if (array_key_exists('email', $_POST)) {
|
||||||
$err = false;
|
$err = false;
|
||||||
$msg = '';
|
$msg = '';
|
||||||
$email = '';
|
$email = '';
|
||||||
|
|
@ -45,7 +45,7 @@ if (array_key_exists('to', $_POST)) {
|
||||||
$to = 'support@example.com';
|
$to = 'support@example.com';
|
||||||
}
|
}
|
||||||
//Make sure the address they provided is valid before trying to use it
|
//Make sure the address they provided is valid before trying to use it
|
||||||
if (array_key_exists('email', $_POST) && PHPMailer::validateAddress($_POST['email'])) {
|
if (PHPMailer::validateAddress($_POST['email'])) {
|
||||||
$email = $_POST['email'];
|
$email = $_POST['email'];
|
||||||
} else {
|
} else {
|
||||||
$msg .= 'Error: invalid email address provided';
|
$msg .= 'Error: invalid email address provided';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue