Phpmailer: PHP 7.3, "filter_var(): explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is deprecated"

Created on 12 Oct 2018  路  8Comments  路  Source: PHPMailer/PHPMailer

Problem description

PHP 7.3 (Release Candidate 3),
PHPMailer->send() causes "filter_var(): explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is deprecated"

Code to reproduce

use PHP 7.3, PHPMailer->send();

Debug output

filter_var(): explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is deprecated

Reference

https://wiki.php.net/rfc/deprecations_php_7_3#filter_flag_scheme_required_and_filter_flag_host_required

Most helpful comment

Sorry for my complain.
My VSCode cache from Github was keeping the old code, instead of update it (even after composer.json update)

All 8 comments

Already fixed in master

This error is also shown to me when I send an email.

Like the thread already says, this has been fixed. Update your PHPMailer.

My version is the last stable (6.0.7) and the problem are still there.

The FILTER_FLAG_SCHEME_REQUIRED constant is not used anywhere in the current release. Double-check your versions.

Sorry for my complain.
My VSCode cache from Github was keeping the old code, instead of update it (even after composer.json update)

Sorry for my complain.
My VSCode cache from Github was keeping the old code, instead of update it (even after composer.json update)

in my composer.json is

"phpmailer/phpmailer": "v6.1.7",

how did you force composer to use the new version?

well, and we use php 7.4

Change your composer.json to:

"phpmailer/phpmailer": "^6.1",

Then update (just PHPMailer) using composer update phpmailer/phpmailer. This pattern will match semver numbering and will get the latest version of PHPMailer 6.x.x, currently 6.1.8.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wilon picture wilon  路  4Comments

codemasher picture codemasher  路  5Comments

LouieZachary picture LouieZachary  路  6Comments

judodan picture judodan  路  5Comments

AndroidDesigner picture AndroidDesigner  路  4Comments