Gidday
I send a set up email when someone registers on my site. I also cc this email to
support@mysite.com so I can monitor registrations to check for spam.
The email goes through to the user just fine, but I'm not getting cc'd on it anymore (it was working fine a while ago, and I can't recall changing the mail set up at all).
It's using Pear and Gmail.
Can anyone see a problem in the code?
PHP Code:
$base = "mysite.com";
require_once "Mail.php";
$subject = "blah";
$body = "blah blah";
$from = "support@".$base;
$to = "$email";
$cc = "support@".$base;
$recipients = $to.", ".$cc;
$host = "ssl://smtp.gmail.com";
$port = "465";
$username = "bladiblah";//google apps username
$password = "blahdiblahblah";//google apps pass
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject,
'Cc' => $cc);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($recipients, $headers, $body);
if (PEAR::isError($mail))
{
//error stuff
}
else
{
//success!!!
}
Thanks for taking a look.