Names with e-mail addresses in Decorator?
Posted: Mon Mar 02, 2009 9:30 am
I have been messing around with PHP mail() and I can confirm most of the disadvantages reported. As a replacement, I found PHPMailer, which works relatively fine but has some drawbacks. E.g., CC: and BCC: are not properly processed.
As a further improvement, I am now evaluating SwiftMailer. This seems to work pretty reliably.
However, there is one aspect that I cannot get hold of. When I try Swift plugin "Decorator", I can indeed send multiple e-mails to multiple receivers. However, the replacements are specified by an associative array, the keys of which are the receivers' e-mail addresses. So far, so good. But I do not manage to add names to the receivers' e-mail addresses (like "John Doe <j.doe@somewhere.xy>", or "\"John Doe\" <j.doe@somewhere.xy>"). These produce an error message from the Decorator, which only accepts pure e-mail addresses or Swift_Address instances. But the latter cannot be used as keys for an associative array, as these keys are not allowed to be arrays or objects.
So the question is: How can I add names to the receivers' e-mail addresses when using the plugin Decorator?
As a further improvement, I am now evaluating SwiftMailer. This seems to work pretty reliably.
However, there is one aspect that I cannot get hold of. When I try Swift plugin "Decorator", I can indeed send multiple e-mails to multiple receivers. However, the replacements are specified by an associative array, the keys of which are the receivers' e-mail addresses. So far, so good. But I do not manage to add names to the receivers' e-mail addresses (like "John Doe <j.doe@somewhere.xy>", or "\"John Doe\" <j.doe@somewhere.xy>"). These produce an error message from the Decorator, which only accepts pure e-mail addresses or Swift_Address instances. But the latter cannot be used as keys for an associative array, as these keys are not allowed to be arrays or objects.
So the question is: How can I add names to the receivers' e-mail addresses when using the plugin Decorator?