Parse a header value that should hold exactly one mailbox, such as From or Sender. Unlike parseEmailAddress this accepts a display name, and unlike parseEmailAddressList it refuses to guess when the value holds more than one address.
From
Sender
parseEmailAddress
undefined unless the given value holds exactly one address.
undefined
import {parseHeaderEmailAddress} from 'parse-email-address';parseHeaderEmailAddress('Jane Doe <jane@example.org>'); // returns the parsed mailboxparseHeaderEmailAddress('jane@example.org, john@example.org'); // returns `undefined` Copy
import {parseHeaderEmailAddress} from 'parse-email-address';parseHeaderEmailAddress('Jane Doe <jane@example.org>'); // returns the parsed mailboxparseHeaderEmailAddress('jane@example.org, john@example.org'); // returns `undefined`
Nothing, this will never throw an error.
Parse a header value that should hold exactly one mailbox, such as
FromorSender. UnlikeparseEmailAddressthis accepts a display name, and unlike parseEmailAddressList it refuses to guess when the value holds more than one address.