We have been using PEAR Mail but as this hasn't been maintained for a while I am wanting to convert to PHPmailer instead. We have an existing email class which wraps the actual mailer so conversion isn't looking too difficult so far.
The problem I have run into is that our existing sendEmail method expects email addresses as a string like
display name <address@domain.tld>, another display name <address2@domain.tld>
Whereas PHPmailer takes each address in turn and passes the address and the display name as separate parameters eg:
$mail->addAddress('address@domain.tld','display name');
I need a routine to parse the old style addresses and separate out the addresses from the display names; I can write this but I don't want to re-invent the wheel and I don't think I can be the first person who has come across this issue (though my searching has failed to find an existing solution).
Can anyone point me at an existing solution to this?
Edited because I had reversed the display name details