Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2012
    Posts
    89
    Thanks
    51
    Thanked 0 Times in 0 Posts

    mail problem cc'ing

    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.

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,090
    Thanks
    51
    Thanked 506 Times in 493 Posts
    To be honest if it just suddenly stopped working then its more likely to be a spam filter on your server that has got fed up with emails using the same template and decided they must all be spam.

    There is no other reason for them not to be arriving if you've not touched the code.

    To be safe, you could always try using phpmailer but i don't think you're going to see any change in the outcome.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  • Users who have thanked tangoforce for this post:

    shaunthomson (11-05-2012)

  • #3
    New Coder
    Join Date
    May 2012
    Posts
    89
    Thanks
    51
    Thanked 0 Times in 0 Posts
    Turns out it's something Google changed in Google Apps. If you send an email to yourself, it skips the inbox and goes straight to sent.

    The best you can do to get around it is set up a new contact in CONTACTS, set it to the email that you are cc'ing yourself on (the one with the same domain as your account email), and then it gets sent to your main account email address, although it shows up as being read (not bold in my email program). I set up a filter for the cc email addy so that it gets a star, to try and make it stand out a little since it's delivered as read.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •