50 $this->_invoker = $invoker;
51 $this->_eventDispatcher = $eventDispatcher;
85 $this->_extraParams = $params;
113 $failedRecipients = (array) $failedRecipients;
115 if ($evt = $this->_eventDispatcher->createSendEvent($this, $message))
117 $this->_eventDispatcher->dispatchEvent($evt,
'beforeSendPerformed');
118 if ($evt->bubbleCancelled())
125 count((array) $message->
getTo())
126 + count((array) $message->
getCc())
127 + count((array) $message->
getBcc())
130 $toHeader = $message->
getHeaders()->get(
'To');
131 $subjectHeader = $message->
getHeaders()->get(
'Subject');
133 $to = $toHeader->getFieldBody();
134 $subject = $subjectHeader->getFieldBody();
148 if (
false !== $endHeaders = strpos($messageStr,
"\r\n\r\n"))
150 $headers = substr($messageStr, 0, $endHeaders) .
"\r\n";
151 $body = substr($messageStr, $endHeaders + 4);
155 $headers = $messageStr .
"\r\n";
161 if (
"\r\n" != PHP_EOL)
163 $headers = str_replace(
"\r\n", PHP_EOL, $headers);
164 $body = str_replace(
"\r\n", PHP_EOL, $body);
168 $headers = str_replace(
"\r\n.",
"\r\n..", $headers);
169 $body = str_replace(
"\r\n.",
"\r\n..", $body);
172 if ($this->_invoker->mail($to, $subject, $body, $headers,
173 sprintf($this->_extraParams, $reversePath)))
178 $evt->setFailedRecipients($failedRecipients);
179 $this->_eventDispatcher->dispatchEvent($evt,
'sendPerformed');
184 $failedRecipients = array_merge(
186 array_keys((array) $message->
getTo()),
187 array_keys((array) $message->
getCc()),
188 array_keys((array) $message->
getBcc())
194 $evt->setFailedRecipients($failedRecipients);
195 $this->_eventDispatcher->dispatchEvent($evt,
'sendPerformed');
213 $this->_eventDispatcher->bindEventListener($plugin);
231 $keys = array_keys($sender);
232 $path = array_shift($keys);
236 $keys = array_keys(
$from);
237 $path = array_shift($keys);