Send the remind email to recipient
@return mixed
175895
public function remind()
    {
        $uri = $this->uri() . $this->id . '/' . self::REMIND;

        return static::put($this->client, $uri);
    }
1253662
public function sendTicket()
    {
        // Get the mail sender or fallback to the admin email
        if (empty($from = Reservation::config()->get('mail_sender'))) {
            $from = Config::inst()->get('Email', 'admin_email');
        }

        $email = new Email();
        $email->setSubject(_t(
            'AttendeeMail.TITLE',
            'Your ticket for {event}',
            null,
            array(
                'event' => $this->Event()->Title
            )
        ));
        $email->setFrom($from);
        $email->setTo($this->getEmail());
        $email->setTemplate('AttendeeMail');
        $email->populateTemplate($this);
        $this->extend('updateTicketMail', $email);
        return $email->send();
    }
921169
public function sendNotification($user)
  {
    $token = Hash::random(35);

    VerifiedUser::create([
      'email' => $user->email,
      'token' => $token
    ]);

    return $this->sendVerifyEmailNotification($user, $token);
  }
593184
protected function buildEmail()
    {
        $email = $this->getEmailObject();

        $email->setSubject($this->getSubject());
        $email->setRecipient($this->getRecipient());
        $email->setFrom($this->getSender());
        $email->setBody($this->getBody());

        return $email;
    }
683783
public function send(Email $email)
    {
        if (!$this->connected()) {
            $this->_connect();
            $this->_auth();
        } else {
            $this->_smtpSend('RSET');
        }

        $this->_sendRcpt($email);
        $this->_sendData($email);

        if (!$this->_config['keepAlive']) {
            $this->_disconnect();
        }

        return $this->_content;
    }
632911
public function sendOne() {
        $db = \Yii::$app->db;

        $transaction = $db->beginTransaction();
        try {
            $id = $db->createCommand('SELECT id FROM {{%email_message}} WHERE status=:status ORDER BY priority DESC, id ASC LIMIT 1 FOR UPDATE', [
                'status' => Message::STATUS_NEW,
            ])->queryScalar();

            if ($id === false) {
                $transaction->rollback();
                return false;
            }

            /** @var Message $model */
            $model = Message::findOne($id);
            $model->status = Message::STATUS_IN_PROGRESS;
            $model->updateAttributes(['status']);

            $transaction->commit();
        } catch (\Exception $e) {
            $transaction->rollback();
            throw $e;
        }

        $transaction = $db->beginTransaction();
        try {

            $result = EmailManager::getInstance()->send(
                $model->from,
                $model->to,
                $model->subject,
                $model->text,
                $model->files,
                $model->bcc
            );
            if ($result) {
                $model->sentAt = new Expression('NOW()');
                $model->status = Message::STATUS_SENT;
            } else {
                $model->status = Message::STATUS_ERROR;
            }

            $model->updateAttributes(['sentAt', 'status']);
            $transaction->commit();
        } catch (\Exception $e) {
            $transaction->rollback();
            throw $e;
        }

        return true;
    }
761362
public function send()
    {
        if ($this->mode == 'pro') {
            ob_end_clean();
            ob_start('ob_gzhandler');
        }
        header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 31536000) . ' GMT');
        header('Cache-Control: must_revalidate, public, max-age=31536000');
        header('X-Server: Qzumba/0.1.8.beta');//for safety ...
        header('X-Powered-By: NEOS PHP FRAMEWORK/1.3.0');//for safety ...

        if ($this->cached &&
        file_exists($this->pathHtmlCache.$this->name.'_cache.html')) {
            return $this->sendWithCach();
        } else {
            //$timer = £TIME.' - '.microtime(true).' = '.round((microtime(true)-£TIME)*1000, 2).'ms';
            exit(eval('?>'.$this->content));
        }
    }
780021
public function getEmailByToken($token)
    {
        $reminder = $this->getReminder()
            ->where('token', '=', $token)
            ->where('created_at', '>=', $this->getOldestValidDate())
            ->first();

        return $reminder->email;
    }
738300
public function send()
    {
        $this->logger->debug(
            'Attempting to send an email',
            $this->to()
        );

        $mail = $this->phpMailer;

        try {
            $this->setSmtpOptions($mail);

            $mail->CharSet = 'UTF-8';

            // Setting reply-to field, if required.
            $replyTo = $this->replyTo();
            if ($replyTo) {
                $replyArr = $this->emailToArray($replyTo);
                $mail->addReplyTo($replyArr['email'], $replyArr['name']);
            }

            // Setting from (sender) field.
            $from = $this->from();
            $fromArr = $this->emailToArray($from);
            $mail->setFrom($fromArr['email'], $fromArr['name']);

            // Setting to (recipients) field(s).
            $to = $this->to();
            foreach ($to as $recipient) {
                $toArr = $this->emailToArray($recipient);
                $mail->addAddress($toArr['email'], $toArr['name']);
            }

            // Setting cc (carbon-copy) field(s).
            $cc = $this->cc();
            foreach ($cc as $ccRecipient) {
                $ccArr = $this->emailToArray($ccRecipient);
                $mail->addCC($ccArr['email'], $ccArr['name']);
            }

            // Setting bcc (black-carbon-copy) field(s).
            $bcc = $this->bcc();
            foreach ($bcc as $bccRecipient) {
                $bccArr = $this->emailToArray($bccRecipient);
                $mail->addBCC($bccArr['email'], $bccArr['name']);
            }

            // Setting attachment(s), if required.
            $attachments = $this->attachments();
            foreach ($attachments as $att) {
                $mail->addAttachment($att);
            }

            $mail->isHTML(true);

            $mail->Subject = $this->subject();
            $mail->Body    = $this->msgHtml();
            $mail->AltBody = $this->msgTxt();

            $ret = $mail->send();

            $this->logSend($ret, $mail);

            return $ret;
        } catch (Exception $e) {
            $this->logger->error(
                sprintf('Error sending email: %s', $e->getMessage())
            );
        }
    }
131731
public function send_message() {
        global $USER;

        $subjectraw = get_config('backup', 'backup_async_message_subject');
        $subjecttext = preg_replace_callback(
                '/\{([-_A-Za-z0-9]+)\}/u',
                array('async_helper', 'lookup_message_variables'),
                $subjectraw);

        $messageraw = get_config('backup', 'backup_async_message');
        $messagehtml = preg_replace_callback(
                '/\{([-_A-Za-z0-9]+)\}/u',
                array('async_helper', 'lookup_message_variables'),
                $messageraw);
        $messagetext = html_to_text($messagehtml);

        $message = new \core\message\message();
        $message->component = 'moodle';
        $message->name = 'asyncbackupnotification';
        $message->userfrom          = $USER;
        $message->userto            = $this->user;
        $message->subject           = $subjecttext;
        $message->fullmessage       = $messagetext;
        $message->fullmessageformat = FORMAT_HTML;
        $message->fullmessagehtml   = $messagehtml;
        $message->smallmessage      = '';
        $message->notification      = '1';

        $messageid = message_send($message);

        return $messageid;
    }
361239
public function sendEmail()
    {
        $mandrill = new Mandrill(Yii::$app->params['mandrill']['key']);
        $message = [
            'html' => $this->html,
            'text' => $this->text,
            'subject' => $this->subject,
            'from_email' => $this->from_email,
            'from_name' => $this->from_name,
            'track_opens' => true,
            'track_clicks' => true,
            'auto_text' => true,
            'to' => [['email' => $this->to_email, 'name' => $this->to_name]],
            'bcc_address' => 'mihai.petrescu@gmail.com',
        ];
        $result = $mandrill->messages->send($message);
        if ($result[0]['status'] == 'sent') {
            $this->status = 'sent';
        } else {
            $this->tries++;
        }
        $this->save();
    }
641768
public function send()
    {
        # Check it $this->to is an array.
        if (!is_array($this->to)) {
            return [
                0 => [
                    'result' => [
                        'httpCode' => 400,
                        'header' => '',
                        'body' => '{"error":{"code":101,"description":"$to must be an array"}}'
                    ]
                ]
            ];
        }

        # Check if there are any recipients.
        if (count($this->to) === 0) {
            return [
                0 => [
                     'result' => [
                         'httpCode' => 400,
                         'header' => '',
                         'body' => '{"error":{"code":102,"description":"No valid recipients"}}'
                     ]
                ]
            ];
        }

        # Check if there is a sender.
        if (strlen($this->from) === 0) {
            return [
                0 => [
                    'result' => [
                        'httpCode' => 400,
                        'header' => '',
                        'body' => '{"error":{"code":106,"description":"Sender missing"}}'
                    ]
                ]
            ];
        }

        # Check if there is a message.
        if (strlen($this->msg) === 0) {
            return [
                0 => [
                    'result' => [
                        'httpCode' => 400,
                        'header' => '',
                        'body' => '{"error":{"code":104,"description":"Text message missing"}}'
                    ]
                ]
            ];
        }

        # Send the messages in chunks.
        $arrChunk = array_chunk($this->to, self::TO_LIMIT_PER_REQUEST);
        foreach ($arrChunk as $i => $to) {
            $data = [
                'encoding' => $this->encoding,
                'to' => $to,
                'message' => $this->msg,
                'from' => $this->from,
                'parts' => $this->parts
            ];

            if (!empty($this->campaignName)) {
                $data['campaignName'] = $this->campaignName;
            }

            $arrChunk[$i]['result'] = $this->doSend($data);
        }

        return $arrChunk;
    }
1314883
public function sendNotification()
    {
        if (($from = self::config()->get('mail_sender')) && empty($from)) {
            $from = Config::inst()->get('Email', 'admin_email');
        }

        if (($to = self::config()->get('mail_receiver')) && empty($to)) {
            $to = Config::inst()->get('Email', 'admin_email');
        }

        $email = new Email();
        $email->setSubject(_t(
            'NotificationMail.TITLE',
            'Nieuwe reservering voor {event}',
            null, array('event' => $this->Event()->Title)
        ));

        $email->setFrom($from);
        $email->setTo($to);
        $email->setTemplate('NotificationMail');
        $email->populateTemplate($this);
        $this->extend('updateNotificationMail', $email);
        return $email->send();
    }
740825
public function send()
    {
        $this->validate();

        $settings = array();
        $settings['helo_hostname'] = $this->_helo_hostname;
        if ($this->_auth) {
            $settings['username'] = $this->_user;
            $settings['password'] = $this->_pass;
        }
        $settings['secure'] = $this->_secure;

        try {
            if (!is_a($this->_SMTP, 'SMTP')) {
                $this->_SMTP = new SMTP($this->_host, $this->_port, $settings);
            }

            // Encode recipient names (but not any numeric array indexes)
            $recipients = array();
            foreach ($this->_recipients as $name => $email) {
                // Support Bcc header
                if (isset($this->_header_fields['Bcc']) && $this->_header_fields['Bcc'] == $email) {
                    continue;
                }

                // if the key is not numeric, qEncode the key.
                $name = General::intval($name) > -1 ? General::intval($name) : EmailHelper::qEncode($name);
                $recipients[$name] = $email;
            }

            // Combine keys and values into a recipient list (name <email>, name <email>).
            $recipient_list = EmailHelper::arrayToList($recipients);

            // Encode the subject
            $subject = EmailHelper::qEncode((string)$this->_subject);

            // Build the 'From' header field body
            $from = empty($this->_sender_name)
                    ? $this->_sender_email_address
                    : EmailHelper::qEncode($this->_sender_name) . ' <' . $this->_sender_email_address . '>';

            // Build the 'Reply-To' header field body
            if (!empty($this->_reply_to_email_address)) {
                $reply_to = empty($this->_reply_to_name)
                            ? $this->_reply_to_email_address
                            : EmailHelper::qEncode($this->_reply_to_name) . ' <'.$this->_reply_to_email_address.'>';
            }

            if (!empty($reply_to)) {
                $this->_header_fields = array_merge(
                    $this->_header_fields,
                    array(
                        'Reply-To' => $reply_to,
                    )
                );
            }

            // Build the body text using attachments, html-text and plain-text.
            $this->prepareMessageBody();

            // Build the header fields
            $this->_header_fields = array_merge(
                $this->_header_fields,
                array(
                    'Message-ID'   => sprintf('<%s@%s>', md5(uniqid()), HTTP_HOST),
                    'Date'         => date('r'),
                    'From'         => $from,
                    'Subject'      => $subject,
                    'To'           => $recipient_list,
                    'MIME-Version' => '1.0'
                )
            );

            // Set header fields and fold header field bodies
            foreach ($this->_header_fields as $name => $body) {
                $this->_SMTP->setHeader($name, EmailHelper::fold($body));
            }

            // Send the email command. If the envelope from variable is set, use that for the MAIL command. This improves bounce handling.
            $this->_SMTP->sendMail(is_null($this->_envelope_from)?$this->_sender_email_address:$this->_envelope_from, $this->_recipients, $this->_body);

            if ($this->_keepalive === false) {
                $this->closeConnection();
            }

            $this->reset();
        } catch (SMTPException $e) {
            throw new EmailGatewayException($e->getMessage());
        }

        return true;
    }
572111
public function getNotificationEmailAddress()
    {
        $email     = null;
        $emailsRaw = $this->getFlexiData($this->getApiURL(),
            ['detail' => 'custom:id,email,kontakty(primarni,email)', 'relations' => 'kontakty']);
        if (is_array($emailsRaw) && !empty($emailsRaw[0])) {
            $emails = $emailsRaw[0];
            if (array_key_exists('email', $emails) && strlen(trim($emails['email']))) {
                $email = $emails['email'];
            }
            if (array_key_exists('kontakty', $emails) && !empty($emails['kontakty'])) {
                foreach ($emails['kontakty'] as $kontakt) {
                    if (($kontakt['primarni'] == 'true') && strlen(trim($kontakt['email']))) {
                        $email = $kontakt['email'];
                        break;
                    }
                }
            }
        }
        return $email;
    }
549152
public function sendEmail()
    {
        /* @var $user \common\models\User */
        $identityClassName = \Yii::$app->user->identityClass;

        $user = $identityClassName::findByUsernameOrEmail($this->identifier);
        //$user = $identityClassName::

        if ($user) {
            if (!$identityClassName::isPasswordResetTokenValid($user->password_reset_token)) {
                $user->generatePasswordResetToken();
            }

            if ($user->save()) {
                if (!$user->email) {
                    return false;
                }

                if ($this->isAdmin) {
                    $resetLink = \skeeks\cms\helpers\UrlHelper::construct('admin/auth/reset-password',
                        ['token' => $user->password_reset_token])->enableAbsolute()->enableAdmin();
                } else {
                    $resetLink = \skeeks\cms\helpers\UrlHelper::construct('cms/auth/reset-password',
                        ['token' => $user->password_reset_token])->enableAbsolute();
                }


                \Yii::$app->mailer->view->theme->pathMap = ArrayHelper::merge(\Yii::$app->mailer->view->theme->pathMap,
                    [
                        '@app/mail' =>
                            [
                                '@skeeks/cms/mail-templates'
                            ]
                    ]);


                $message = \Yii::$app->mailer->compose('@app/mail/password-reset-token', [
                    'user' => $user,
                    'resetLink' => $resetLink
                ])
                    ->setFrom([\Yii::$app->cms->adminEmail => \Yii::$app->cms->appName])
                    ->setTo($user->email)
                    ->setSubject(\Yii::t('skeeks/cms',
                            'The request to change the password for') . \Yii::$app->cms->appName);

                return $message->send();
            }
        }

        return false;
    }
736168
public function send()
    {
        $contactFormBridge = $this->getContainer()->get(ContactFormBridgeInterface::class);

        $form = $contactFormBridge->getContactForm();
        $form->handleRequest($this->getMappedContactFormRequest());

        if ($form->isValid()) {
            $this->sendContactMail(
                $form->email->getValue(),
                $form->subject->getValue(),
                $contactFormBridge->getContactFormMessage($form)
            );
        } else {
            foreach ($form->getErrors() as $error) {
                Registry::getUtilsView()->addErrorToDisplay($error);
            }

            return false;
        }
    }