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') {
                    $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.

5 Years
Discussion Span
Last Post by broj1

You could add this code somewhere at the end of the snippet above:

die('<pre>' . print_r($send_params, 1) . '</pre>');

This will display array of the final version of all parameters needed for sending. Now you can go through each element and check it. Carefuly look at the $send_params['headers'] if it is assembled correctly. You can also post the output here fo us to look at it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.