PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Mail sends through gmail to any email account.... except...

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail
View previous topic :: View next topic  
Author Message
emmitt2299



Joined: 24 Jun 2010
Posts: 3

PostPosted: Wed Jan 05, 2011 12:49 am    Post subject: Mail sends through gmail to any email account.... except... Reply with quote

Mail sends through gmail to any email account.... except any domain on the same VPS.

Here's what I mean.

I have 6 domains hosted on the same VPS. All of my domains except 1 use gmail as its mail server.

When I send an email through Pear Mail, I send it THROUGH gmail's smtp server. Here's the code I use for that:

Code:

                $sendtoemail = '[email protected]';
      $host = "ssl://smtp.googlemail.com";
                $port = "485";
                $username = "[email protected]";
                $password = "xxxxxxxxx";
      $crlf = "\n";
      $hdrs = array(
                    'From'    => '[email protected]',
               'CC' => '[email protected]',
                    'Subject' => 'A new note for potential client, '.$fname.' '.$lname.' ',
               
                    );

            $mime = new Mail_mime($crlf);

            $mime->setTXTBody($text);
            
                           $body = $mime->get();
                           $hdrs = $mime->headers($hdrs);

            $mail =& Mail::factory('mail',
      array ('host' => $host,
                    'port' => $port,
                    'auth' => true,
                    'username' => $username,
                    'password' => $password));
             $mail->send($sendtoemail, $hdrs, $body)

;

The email is received IF one of the following are true:
1. if the "$sendtoemail" variable contains an email address that is on my VPS, but does NOT use googlemail as its mail server (instead uses the VPS mail server)
2. If the "$sendtoemail" variable contains an email address NOT on my VPS, including an independent gmail account.

The email is NOT received IF:
-- the $sendtoemail variable contains an email address ON the VPS AND that domain uses googlemail as its mail server, even when its a different domain from the one that sends.

It is NOT putting into junkmail.... its like its just not being received at all. Any ideas what could be causing this?

If you help, I promise to give you +2 good lucks. Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement