I have a PEAR mailing script that is used to send newsletters from a clients website. I've used the same code before to produce another newsletter system and it has worked well and been used to send emails to various addresses, however our latest client hasn't been receiving any of the emails.
When the newsletter is sent from the site to the various subscribers, including gmail, hotmail, yahoo and our own company emails, the emails are received correctly by all but the clients email addresses. As there is nothing different between their mailing system and our own, which is run from the same hosting company, I have to conclude that it is something to do with the domain.
The emails are being sent to the addresses from the system, as I have a log file storing the email addresses when the mail out function is called, but the newsletter never appears in the inbox. I have created a new email account for the domain and that too isn't receiving the emails. It's not going into a spam folder as the webmail system marks spam by adding SPAM into the subject.
I've tried to log if there are any errors using the following
$mail =& Mail::factory('mail');
foreach($subscribers as $recipient)
{
$send_newsletter = $mail->send($recipient, $headers, $body);
// LOG INFO
$message = $recipient;
if($send_newsletter)
{
$message .= ' SENT';
}
elseif(PEAR::isError($send_newsletter))
{
$message .= ' ERROR: '.$send_newsletter->getMessage();
}
$message .= ' | ';
fwrite($log_file,$message);
}
However this simple returns SENT for all recipients, so in theory there isn't anything wrong with the mailing function. [EDIT - though I've just noticed that this may not work as i'm using the 'mail' type and error reporting seems to only apply for 'sendmail' or 'smtp' - is that true?)
I don't know a great deal about PEAR or the mailing function so I may be missing something important, but I'd have thought seeing the last thing to happen is sending the email out, and that seems to work, then it should reach the clients inbox.
What reasons are there that a specific domain would not be able to accept emails when other domains hosted eith the same company can.
Any help is greatly appreciated as the client and myself are getting both confused and frustrated by the whole thing.
Cheers