I am currently working on an open source dating script. But I have one bug that I just can't seem to fix.
I am unable to send system generated emails to Yahoo! and gmail.
I have done a lot of searching online, but can't seem to get it working. I have noticed that this could be something to do with the headers, in the sendMimemail.php the headers are:
// Get flat representation of headers, parsing
// Cc and Bcc as we go
foreach ($this->headers as $name => $value) {
if ($name == 'Cc' OR $name == 'Bcc') {
$addresses = Mail_RFC822::parseAddressList($value, $this->smtp_params['helo'], null, false);
foreach ($addresses as $address) {
$smtp_recipients[] = sprintf('%s@%s', $address->mailbox, $address->host);
}
}
if ($name == 'Bcc') {
continue;
}
$headers[] = $name . ': ' . $this->encodeHeader($value, $this->build_params['head_charset']);
}
// Add To header based on $recipients argument
$headers[] = 'To: ' . $this->encodeHeader(implode(', ', $recipients), $this->build_params['head_charset']);
// Add headers to send_params
$send_params['headers'] = $headers;
$send_params['recipients'] = array_values(array_unique($smtp_recipients));
$send_params['body'] = $this->output;
// Setup return path
if (isset($this->return_path)) {
$send_params['From'] = $this->return_path;
} elseif (!empty($this->headers['From'])) {
$From = Mail_RFC822::parseAddressList($this->headers['From']);
$send_params['From'] = sprintf('%s@%s', $From[0]->mailbox, $From[0]->host);
} else {
$send_params['From'] = 'postmaster@' . $this->smtp_params['helo'];
}
But it just isn't getting to Yahoo! and gmail. Any ideas what the issue is? Any help would be appreciated.