Opened 7 years ago
Closed 6 years ago
#47467 closed defect (bug) (fixed)
is_email and PHPMailer validateAddress() method does not match
| Reported by: | ggPixel | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.5 |
| Component: | Version: | ||
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
Sorry if this is not meant to be posted here.
Before sending an email using wp_mail(), I check email addresses with is_email() to make sure its valid. It kept on failing with PHPMailer returning an error "You must provide at least one recipient email address" even though is_email() returns a valid email address. After some investigation I realised that PHPMailer does its own validation on emails and it failed.
In my case the email that failed had a dot in front of the @ symbol (test.@…).
My questions is, shouldn't is_email() and PHPMailer's validateAddress() method work the same?
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Hello there, and thank you for bringing this up!
The issue described in the ticket should have been fixed in r48645 , where the default validator for validateAddress is set to
is_email.Prior that changeset the
validateAddressmethod was in deed using the PHPMailer's internal validation, which is not on par with theis_emailfunction.