| | |
| | | // Send the message's headers and the body as SMTP data. |
| | | if (PEAR::isError($result = $this->conn->data($data, $text_headers))) |
| | | { |
| | | $this->error = array('label' => 'smtperror', 'vars' => array('msg' => $result->getMessage())); |
| | | $err = $this->conn->getResponse(); |
| | | if (count($err)>1 && $err[0] != 354 && $err[0] != 250) |
| | | $msg = sprintf('[%d] %s', $err[0], $err[1]); |
| | | else |
| | | $msg = $result->getMessage(); |
| | | |
| | | $this->error = array('label' => 'smtperror', 'vars' => array('msg' => $msg)); |
| | | $this->response[] .= "Failed to send data"; |
| | | $this->reset(); |
| | | return false; |
| | |
| | | |
| | | $addresses = array(); |
| | | $recipients = rcube_explode_quoted_string(',', $recipients); |
| | | |
| | | |
| | | reset($recipients); |
| | | while (list($k, $recipient) = each($recipients)) |
| | | { |
| | | $a = explode(" ", $recipient); |
| | | while (list($k2, $word) = each($a)) |
| | | { |
| | | if ((strpos($word, "@") > 0) && (strpos($word, "\"")===false)) |
| | | if (strpos($word, "@") > 0 && $word[strlen($word)-1] != '"') |
| | | { |
| | | $word = preg_replace('/^<|>$/', '', trim($word)); |
| | | if (in_array($word, $addresses)===false) |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | ?> |