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';
|
||||
|
||||
if (array_key_exists('to', $_POST)) {
|
||||
if (array_key_exists('email', $_POST)) {
|
||||
$err = false;
|
||||
$msg = '';
|
||||
$email = '';
|
||||
|
|
@ -45,7 +45,7 @@ if (array_key_exists('to', $_POST)) {
|
|||
$to = 'support@example.com';
|
||||
}
|
||||
//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'];
|
||||
} else {
|
||||
$msg .= 'Error: invalid email address provided';
|
||||
|
|
@ -99,4 +99,4 @@ if (array_key_exists('to', $_POST)) {
|
|||
echo $msg;
|
||||
} ?>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Reference in New Issue