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:
Code: Select all
$sendtoemail = 'blah@gmail.com';
$host = "ssl://smtp.googlemail.com";
$port = "485";
$username = "xxxxxxx@stepstonere.com";
$password = "xxxxxxxxx";
$crlf = "\n";
$hdrs = array(
'From' => 'xxxxxxx@stepstonere.com',
'CC' => 'dan@stepstonere.com',
'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!