patch 2.6

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   patch 2.6
lumax
CZ Super Newbie
usa.gif alaska.gif
Gender: Male
Status: Offline
Joined: Nov 14, 2003
0.01 posts per day
Posts: 60
Points: 3,953
   
After installing patch 2.6 to phpnuke 7.3 patched to 2.5 with forums upgraded to 2.0.10, I receive this error message when posting private messages:




General Error

Failed sending email :: PHP ::

DEBUG MODE

Line : 275
File : /home/XXXXX/public_html/XXXXXX/includes/emailer.php


The personal message is sent and received, so I have no idea why this is happening but would like to correct.




_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
Whats lines 250 -350?




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: patch 2.6
lumax
CZ Super Newbie
usa.gif alaska.gif
Gender: Male
Status: Offline
Joined: Nov 14, 2003
0.01 posts per day
Posts: 60
Points: 3,953
   
Thanks for your response Telli, heres the code:

      // Build header
      $this->extra_headers = (($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') . (($this->from != '') ? "From: $this->from\n" : "From: " . $board_config['board_email'] . "\n") . "Return-Path: " . $board_config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $board_config['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/plain; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: Produced By phpBB2\n" . $this->extra_headers . (($cc != '') ? "Cc: $cc\n" : '')  . (($bcc != '') ? "Bcc: $bcc\n" : '');

                // Send message ... removed $this->encode() from subject for time being
                if ( $this->use_smtp )
                {
                        if ( !defined('SMTP_INCLUDED') )
                        {
                                include('includes/smtp.' . $phpEx);
                        }

                        $result = smtpmail($to, $this->subject, $this->msg, $this->extra_headers);
                }
                else
                {
         $empty_to_header = ($to == '') ? TRUE : FALSE;
         $to = ($to == '') ? (($board_config['sendmail_fix']) ? ' ' : 'Undisclosed-recipients:;') : $to;
                        $result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers);

                        if (!$result && !$board_config['sendmail_fix'] && $empty_to_header)
                        {
                                $to = ' ';

                                $sql = "UPDATE " . CONFIG_TABLE . "
                                        SET config_value = '1'
                                        WHERE config_name = 'sendmail_fix'";
                                if (!$db->sql_query($sql))
                                {
                                        message_die(GENERAL_ERROR, 'Unable to update config table', '', __LINE__, __FILE__, $sql);
                                }

                                $board_config['sendmail_fix'] = 1;
                                $result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers);
                        }
                }

                // Did it work?
                if (!$result)
                {
                        message_die(GENERAL_ERROR, 'Failed sending email :: ' . (($this->use_smtp) ? 'SMTP' : 'PHP') . ' :: ' . $result, '', __LINE__, __FILE__);
                }

                return true;
        }

        // Encodes the given string for proper display for this encoding ... nabbed
        // from php.net and modified. There is an alternative encoding method which
        // may produce lesd output but it's questionable as to its worth in this
        // scenario IMO
        function encode($str)
        {
                if ($this->encoding == '')
                {
                        return $str;
                }

                // define start delimimter, end delimiter and spacer
                $end = "?=";
                $start = "=?$this->encoding?B?";
                $spacer = "$end\r\n $start";

                // determine length of encoded text within chunks and ensure length is even
                $length = 75 - strlen($start) - strlen($end);
                $length = floor($length / 2) * 2;

                // encode the string and split it into chunks with spacers after each chunk
                $str = chunk_split(base64_encode($str), $length, $spacer);

                // remove trailing spacer and add start and end delimiters
                $str = preg_replace('#' . phpbb_preg_quote($spacer, '#') . '$#', '', $str);

                return $start . $str . $end;
        }

        //
        // Attach files via MIME.
        //
        function attachFile($filename, $mimetype = "application/octet-stream", $szFromAddress, $szFilenameToDisplay)
        {
                global $lang;
                $mime_boundary = "--==================_846811060==_";

                $this->msg = '--' . $mime_boundary . "\nContent-Type: text/plain;\n\tcharset=\"" . $lang['ENCODING'] . "\"\n\n" . $this->msg;

                if ($mime_filename)
                {
                        $filename = $mime_filename;
                        $encoded = $this->encode_file($filename);
                }

                $fd = fopen($filename, "r");
                $contents = fread($fd, filesize($filename));

                $this->mimeOut = "--" . $mime_boundary . "\n";
                $this->mimeOut .= "Content-Type: " . $mimetype . ";\n\tname=\"$szFilenameToDisplay\"\n";
                $this->mimeOut .= "Content-Transfer-Encoding: quoted-printable\n";
                $this->mimeOut .= "Content-Disposition: attachment;\n\tfilename=\"$szFilenameToDisplay\"\n\n";

                if ( $mimetype == "message/rfc822" )
                {
                        $this->mimeOut .= "From: ".$szFromAddress."\n";
                        $this->mimeOut .= "To: ".$this->emailAddress."\n";
                        $this->mimeOut .= "Date: ".date("D, d M Y H:i:s") . " UT\n";
                        $this->mimeOut .= "Reply-To:".$szFromAddress."\n";
                        $this->mimeOut .= "Subject: ".$this->mailSubject."\n";
                        $this->mimeOut .= "X-Mailer: PHP/".phpversion()."\n";
                        $this->mimeOut .= "MIME-Version: 1.0\n";
                }

                $this->mimeOut .= $contents."\n";
                $this->mimeOut .= "--" . $mime_boundary . "--" . "\n";

                return $out;
                // added -- to notify email client attachment is done
        }




_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

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
You cannot attach files in this forum
You cannot download files in this forum