WordPress.org

Make WordPress Core

Opened 6 weeks ago

#47467 new defect (bug)

is_email and PHPMailer validateAddress() method does not match

Reported by: ggPixel Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Mail Keywords:
Focuses: Cc:

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?

Change History (0)

Note: See TracTickets for help on using tickets.