Email recipients with names – why not?
-
The notification default email carrier uses
wp_mail()
to send its emails, so according to the wp_mail() function reference, it would be possible to send to recipients of the format ‘User Name <[email protected]>’.Looking at
parse_value()
in the default email recipient, I see the following:$parsed_emails = []; $emails = is_array( $value ) ? $value : explode( ',', $value ); foreach ( $emails as $email ) { $parsed_emails[] = sanitize_email( $email ); }
So it would seem that recipients of the format ‘User Name <[email protected]>’ will be stripped down to ‘[email protected]’ by
sanitize_email()
.I am considering creating a recipient that supports the ‘User Name <[email protected]>’ format. But before I do, I am curious as to if you have any particular reason to not support the ‘User Name <[email protected]>’ format, or if you maybe encountered any stumbling blocks that made it impractical.
Thank you.
- The topic ‘Email recipients with names – why not?’ is closed to new replies.