Part of the EllisLab Network
   
 
Multiple CCs not working
Posted: 29 January 2007 10:27 AM   [ Ignore ]  
Summer Student
Total Posts:  9
Joined  01-19-2007

I can’t seem to get CI to send email to multiple CC addresses. I’ve tried:

$this->email->cc('bob@xyz.com', 'bill@xyz.com');

AND

$this->email->cc('bob@xyz.com, bill@xyz.com');

Neither worked, so I tried an array:

$recipients = array(
         
'bob@xyz.com',
         
'bill@xyz.com');

$this->email->cc('$recipients');

The user guide seems pretty straightforward - what am I missing?

Profile
 
 
Posted: 29 January 2007 10:38 AM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRankRankRank
Total Posts:  6762
Joined  03-23-2006

Hmm… is mail working without ccs?  What about only 1 cc?

This one

$this->email->cc('bob@xyz.com, bill@xyz.com');


looks right to me, but the other 2 won’t work.

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design
BambooInvoice - Open Source, CodeIgniter powered invoicing.

Profile
MSG
 
 
Posted: 29 January 2007 10:56 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  207
Joined  12-22-2006

There is an error in the userguide I just noticed:

$recipients = array(
         
'bob@xyz.com',
         
'bill@xyz.com');

$this->email->cc('$recipients');


will not work because of the single quotes around the parameter. Change to:

$this->email->cc('$recipients');

Why the other two options wont work I dont really know.

Profile
 
 
Posted: 29 January 2007 10:58 AM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
RankRankRankRankRankRank
Total Posts:  6762
Joined  03-23-2006

I don’t see that in the userguide.  Is it in the email page and I’m just blind?  (wouldn’t be the first time)

edit: OK, I see its under to and not cc.  I’ve fixed it, and in the next release of CI that’ll be fixed (I can’t change the site right now).

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design
BambooInvoice - Open Source, CodeIgniter powered invoicing.

Profile
MSG
 
 
Posted: 29 January 2007 11:13 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
RankRankRank
Total Posts:  552
Joined  06-17-2006

I’ve fixed it, and in the next release of CI that’ll be fixed…

Wow! Instant bug fix. Sign of times folks. Hold on to ya seats!

 Signature 

CodeCrafter - Open Source Code Generation for CI

Profile
 
 
Posted: 29 January 2007 11:33 AM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  9
Joined  01-19-2007
Mark van der Walle - 29 January 2007 10:56 AM

There is an error in the userguide I just noticed:

$recipients = array(
         
'bob@xyz.com',
         
'bill@xyz.com');

$this->email->cc('$recipients');


will not work because of the single quotes around the parameter. Change to:

$this->email->cc('$recipients');

Why the other two options wont work I dont really know.

I tried using double quotes, that didn’t work. There doesn’t seem to be a difference between your suggestion and mine. I picked up the array suggestion from another thread, although it’s mentioned as doable in the user guide.

Profile
 
 
Posted: 29 January 2007 11:34 AM   [ Ignore ]   [ # 6 ]  
Summer Student
Total Posts:  9
Joined  01-19-2007
Derek Allard - 29 January 2007 10:38 AM

Hmm… is mail working without ccs?  What about only 1 cc?

This one

$this->email->cc('bob@xyz.com, bill@xyz.com');


looks right to me, but the other 2 won’t work.

Mail does work for 1 CC. It’ll actually send to the first, but not the second.

Profile
 
 
Posted: 29 January 2007 11:54 AM   [ Ignore ]   [ # 7 ]  
Research Assistant
RankRankRank
Total Posts:  552
Joined  06-17-2006

Show the output of

echo $this->email->print_debugger();


and filter out info that you think might be sensitive.

 Signature 

CodeCrafter - Open Source Code Generation for CI

Profile
 
 
Posted: 29 January 2007 12:24 PM   [ Ignore ]   [ # 8 ]  
Administrator
Avatar
RankRankRankRankRankRank
Total Posts:  6762
Joined  03-23-2006
T-Zee - 29 January 2007 11:34 AM
Derek Allard - 29 January 2007 10:38 AM

Hmm… is mail working without ccs?  What about only 1 cc?

This one

$this->email->cc('bob@xyz.com, bill@xyz.com');


looks right to me, but the other 2 won’t work.

Mail does work for 1 CC. It’ll actually send to the first, but not the second.

Hm.  What if you flip the order of the cc’s.  Does it still send only to the first one?

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design
BambooInvoice - Open Source, CodeIgniter powered invoicing.

Profile
MSG
 
 
Posted: 29 January 2007 02:24 PM   [ Ignore ]   [ # 9 ]  
Summer Student
Total Posts:  9
Joined  01-19-2007
Derek Allard - 29 January 2007 12:24 PM
T-Zee - 29 January 2007 11:34 AM
Derek Allard - 29 January 2007 10:38 AM

Hmm… is mail working without ccs?  What about only 1 cc?

This one

$this->email->cc('bob@xyz.com, bill@xyz.com');


looks right to me, but the other 2 won’t work.

Mail does work for 1 CC. It’ll actually send to the first, but not the second.

Hm.  What if you flip the order of the cc’s.  Does it still send only to the first one?

Strange, it’s now working. I had tried all sorts of orders with different email addresses. I could break down all the peculiarities, but I’ll pass on that for now and just move forward. I am curious as to how you get the array to work since that’s allowed ... per the documentation.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 66426 Total Logged-in Users: 40
Total Topics: 84790 Total Anonymous Users: 3
Total Replies: 455004 Total Guests: 240
Total Posts: 539794    
Members ( View Memberlist )
Newest Members:  llogocsaturkeytherendStudioGeorgiaJZeerfedegheEdgedcenticeRoger_Mxcamilo