Index: smtp.php =================================================================== --- smtp.php (revision 250) +++ smtp.php (revision 268) @@ -96,6 +96,7 @@ $greeting = $this->get_data(); if (is_resource($this->connection)) { + $this->status = SMTP_STATUS_CONNECTED; return $this->auth ? $this->ehlo() : $this->helo(); } else { $this->errors[] = 'Failed to connect to server: '.$errstr; @@ -368,4 +369,4 @@ } // End of class -?> \ No newline at end of file +?> Index: Rmail.php =================================================================== --- Rmail.php (revision 250) +++ Rmail.php (revision 268) @@ -773,11 +773,13 @@ case 'smtp': require_once(dirname(__FILE__) . '/smtp.php'); require_once(dirname(__FILE__) . '/RFC822.php'); - $smtp = &smtp::connect($this->smtp_params); + $smtp = new smtp($this->smtp_params); + $smtp->connect(); // Parse recipients argument for internet addresses foreach ($recipients as $recipient) { - $addresses = Mail_RFC822::parseAddressList($recipient, $this->smtp_params['helo'], null, false); + $rfc822 = new Mail_RFC822(); + $addresses = $rfc822->parseAddressList($recipient, $this->smtp_params['helo'], null, false); foreach ($addresses as $address) { $smtp_recipients[] = sprintf('%s@%s', $address->mailbox, $address->host); } @@ -789,7 +791,8 @@ // 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); + $rfc822 = new Mail_RFC822(); + $addresses = $rfc822->parseAddressList($value, $this->smtp_params['helo'], null, false); foreach ($addresses as $address) { $smtp_recipients[] = sprintf('%s@%s', $address->mailbox, $address->host); } @@ -811,7 +814,8 @@ if (isset($this->return_path)) { $send_params['from'] = $this->return_path; } elseif (!empty($this->headers['From'])) { - $from = Mail_RFC822::parseAddressList($this->headers['From']); + $rfc822 = new Mail_RFC822(); + $from = $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']; @@ -1109,4 +1113,4 @@ return '8bit'; } } -?> \ No newline at end of file +?>