amccarter
04-08-2007, 03:41 PM
I am using Google Apps to handle the email for my domain.
On the site, there is a simple contact form that uses the php mail() function. It works fine for any email address outside the domain. But if I set it to send the email to an address inside the domain, it goes to the local mailbox (ie: in Horde or Squirrelmail), instead of to the Google Apps mailbox.
All other mail sent to internal addresses go through the Google Apps mailbox just fine. Any idea why sendmail won't follow the rules?
For the record, here's the script:
$message = wordwrap($message,70);
$email_to = "me@mydomain.com";
$headers = "From: contact@mydomain.com";
$body = "Name: $name <$email_from>\nPhone: $phone\nMessage: $message"
mail($email_to, $subject, $body, $headers);
Like I said, if I change $email_to to some address that isn't on mydomain.com (like say, foo@bar.com), it sends the mail just fine. And actually, even sending it to me@mydomain.com, it works, but it only shows up on the local webmail inbox, not the Google Apps inbox, like it should.
On the site, there is a simple contact form that uses the php mail() function. It works fine for any email address outside the domain. But if I set it to send the email to an address inside the domain, it goes to the local mailbox (ie: in Horde or Squirrelmail), instead of to the Google Apps mailbox.
All other mail sent to internal addresses go through the Google Apps mailbox just fine. Any idea why sendmail won't follow the rules?
For the record, here's the script:
$message = wordwrap($message,70);
$email_to = "me@mydomain.com";
$headers = "From: contact@mydomain.com";
$body = "Name: $name <$email_from>\nPhone: $phone\nMessage: $message"
mail($email_to, $subject, $body, $headers);
Like I said, if I change $email_to to some address that isn't on mydomain.com (like say, foo@bar.com), it sends the mail just fine. And actually, even sending it to me@mydomain.com, it works, but it only shows up on the local webmail inbox, not the Google Apps inbox, like it should.