PHP Classes

CC and BCC ?

Recommend this page to a friend!

      pop3.class.inc  >  All threads  >  CC and BCC ?  >  (Un) Subscribe thread alerts  
Subject:CC and BCC ?
Summary:How do i get the CC and BCC from an email.
Messages:2
Author:Andrew Gill
Date:2008-07-15 13:27:53
Update:2008-07-16 11:56:41
 

 


  1. CC and BCC ?   Reply   Report abuse  
Picture of Andrew Gill Andrew Gill - 2008-07-15 13:27:53
Everything is working fine for me except i would like get to the CC and BCC of an email... Is this possible?

Below is not working for me:

$email['headers']['CC']
$email['headers']['BCC']

I see CC and BCC mentioned in the pop3.class.inc but cannot figure out how to get to it. Any ideas much appreciated.

Thanks,
Andy

  2. Re: CC and BCC ?   Reply   Report abuse  
Picture of Steffen Stollfuß Steffen Stollfuß - 2008-07-16 11:56:41 - In reply to message 1 from Andrew Gill
Hi,

The CC and BCC Reciever addresses are stored in the email header.

When you get a mail with the class you get an array.

$array = array( "<HEADER>",
"a header line",
"CC: Hans Mustermann <hans.mustermann@web.de>"
"and soon",
"</HEADER>" );

while( ($buf = next($array)) != "</HEADER>" )
{
if( preg_match("/^(CC|BCC)/i",$buf) )
{
// Now you have the line
}
}

Good Luck