How to use array recipient list on swiftmailer?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shneoh
Forum Commoner
Posts: 38
Joined: Mon Sep 25, 2006 2:23 am
Location: Malaysia

How to use array recipient list on swiftmailer?

Post by shneoh »

Hi,

I was tried the swiftmailer few days but still cant get the array recipient list done. Any working example can give?

Here's the code:

Code: Select all

//----  Receipent Address  ----//
	$TO = array(
	        array('Member A','<A@A.com.my>'),
		array('Member B','<B@B.com.my>'),
		array('Member C','<C@gmail.com>')
	);
Is this correct?

Thanks,
Nelson
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Take out the < and >.

I can't remember what my code looks like there but I should probably scan to check if you've put them in already.
shneoh
Forum Commoner
Posts: 38
Joined: Mon Sep 25, 2006 2:23 am
Location: Malaysia

Post by shneoh »

There is another question:

When I use addCc as follow, it returns no errors and never send mails to these CC receipients:

Code: Select all

$mailer->addCc("Name1" <email@address.com>);
$mailer->addCc("Name2" <email2@address.com>);
$mailer->addCc("Name3" <email3@address.com>);
But when I changed to follow, it works:

Code: Select all

$mailer->addCc('email@address.com');
$mailer->addCc('email2@address.com');
$mailer->addCc('email3@address.com');
Any hints?

Just a suggestion: The online documents should have at least one example on how to correctly code them. The information provided there is not really friendly to all people.

ps: I noted about this dev forum from your swiftmailer webpage. Thanks for the link. :)
Post Reply