Phalcon\Mailer\Message::send PHP Method

send() public method

All recipients (with the exception of Bcc) will be able to see the other recipients this message was sent to. Recipient/sender data will be retrieved from the Message object. The return value is the number of recipients who were accepted for delivery. Events: - mailer:beforeSend - mailer:afterSend
See also: Swift_Mailer::send()
public send ( ) : integer
return integer
    public function send()
    {
        $eventManager = $this->getManager()->getEventsManager();
        if ($eventManager) {
            $result = $eventManager->fire('mailer:beforeSend', $this);
        } else {
            $result = true;
        }
        if ($result === false) {
            return false;
        }
        $this->failedRecipients = [];
        $count = $this->getManager()->getSwift()->send($this->getMessage(), $this->failedRecipients);
        if ($eventManager) {
            $eventManager->fire('mailer:afterSend', $this, [$count, $this->failedRecipients]);
        }
        return $count;
    }