Sends the smart email.
192595
def smart_email_send(self, smart_email_id, to, consent_to_track, cc=None, bcc=None, attachments=None, data=None, add_recipients_to_list=None):
        """"""
        validate_consent_to_track(consent_to_track)
        body = {
            "To": to,
            "CC": cc,
            "BCC": bcc,
            "Attachments": attachments,
            "Data": data,
            "AddRecipientsToList": add_recipients_to_list,
            "ConsentToTrack": consent_to_track,
        }
        response = self._post("/transactional/smartEmail/%s/send" %
                              smart_email_id, json.dumps(body))
        return json_to_py(response)
1270134
public void send(Email email) throws EmailException {
    synchronized (this) {
      EmailConnection connection = openConnection();
      connection.connect();
      
      connection.send(email);
      
      connection.close();
    }
  }
1183665
public function afterSave()
    {
        // Only send the confirmation email if emails are turned on in the config
        if ($this->getDI()->get('config')->useMail) {

            if ($this->active == 'N') {

                $emailConfirmation = new EmailConfirmations();

                $emailConfirmation->usersId = $this->id;

                if ($emailConfirmation->save()) {
                    $this->getDI()
                        ->getFlash()
                        ->notice('A confirmation mail has been sent to ' . $this->email);
                }
            }
        }
    }
1189782
def email(self, value):
        """"""
        email = self.wait.until(expected.visibility_of_element_located(
            self._email_input_locator))
        email.clear()
        email.send_keys(value)
1078941
public function send()
    {
        $useHtml = (bool)$this->getConfig("use_html");

        $mergedHeaders = $this->getMergedHeaders();

        if ($useHtml) {
            $this->setHtmlEmails();
        }

        if ($this->hasConfig("attachedFile")) {
            $status = wp_mail(
                $this->getConfig("to"),
                $this->getConfig("title"),
                $this->getConfig("contents"),
                $this->toHeaderString($mergedHeaders) . $this->buildBCCString(),
                $this->getConfig("attachedFile")
            );
        } else {
            $status = wp_mail(
                $this->getConfig("to"),
                $this->getConfig("title"),
                $this->getConfig("contents"),
                $this->toHeaderString($mergedHeaders) . $this->buildBCCString()
            );
        }

        $logMessage = $status ?
            sprintf("<success>Sent an email</success> to %s with title \"%s\" and a body length of %d characters.", implode(", ", (array)$this->getConfig("to")), $this->getConfig("title"), strlen($this->getConfig("contents"))) :
            sprintf("<warning>Failed to send an email</warning> to %s with title \"%s\" and a body length of %d characters.",  implode(", ", (array)$this->getConfig("to")), $this->getConfig("title"), strlen($this->getConfig("contents")));

        Strata::app()->log($logMessage, "<info>Strata:Mailer</info>");

        if ($useHtml) {
            $this->setHtmlEmails(false);
        }

        return $status;
    }
72788
public function send()
  {
    foreach($this->headers as $header) {
      header($header);
    }

    $response = array();

    if ($this->message != null) {
      $response = $this->message;
    } elseif ($this->data != []) {
      $response = array_merge($response, $this->data);
    }

    if (is_array($response)) {
      echo json_encode($response);
      return;
    }

    echo $response;
  }
841490
def send(self, envelope):
        """"""
        if not self.is_connected:
            self._connect()

        msg = envelope.to_mime_message()
        to_addrs = [envelope._addrs_to_header([addr]) for addr in envelope._to + envelope._cc + envelope._bcc]

        return self._conn.sendmail(msg['From'], to_addrs, msg.as_string())
74722
public function send()
    {
        $args = func_get_args();
        if (count($args) > 1) {
            $message = call_user_func_array('sprintf', $args);
        } else {
            $message = $args[0];
        }
        $this->response->send($message);
    }
174491
def send_reset_password_email(self, user, user_email):
        """"""

        # Verify config settings
        if not self.user_manager.USER_ENABLE_EMAIL: return
        assert self.user_manager.USER_ENABLE_FORGOT_PASSWORD

        # The reset_password email is sent to a specific user_email.email or user.email
        email = user_email.email if user_email else user.email

        # Generate a reset_password_link
        token = self.user_manager.generate_token(user.id)
        reset_password_link = url_for('user.reset_password', token=token, _external=True)

        # Render email from templates and send it via the configured EmailAdapter
        self._render_and_send_email(
            email,
            user,
            self.user_manager.USER_RESET_PASSWORD_EMAIL_TEMPLATE,
            reset_password_link=reset_password_link,
        )
686340
public function send()
    {
        if (!$this->isEnable()) {
            return;
        }

        $tags = $this->getTags();
        if (!empty($tags)) {
            \header($this->getHeaderName() . ': ' . \implode(',', $tags));
        }
    }
1188029
public void sendEmail(final String theTo, final String theFrom, final String theSubject,
                          final String theContent) {
        if (null == smtpServerSetup) {
            throw new IllegalStateException("Can not send mail, no SMTP or SMTPS setup found");
        }
        GreenMailUtil.sendTextEmail(theTo, theFrom, theSubject, theContent, smtpServerSetup);
    }
501586
public function email(): void
    {
        $oInput     = Factory::service('Input');
        $oUserModel = Factory::model('User', 'nails/module-auth');
        $action     = $oInput->post('action');
        $sEmail     = trim($oInput->post('email'));
        $iId        = (int) $oInput->post('id') ?: null;

        switch ($action) {

            case 'add':
                $bIsPrimary  = (bool) $oInput->post('isPrimary');
                $bIsVerified = (bool) $oInput->post('isVerified');

                if ($oUserModel->emailAdd($sEmail, $iId, $bIsPrimary, $bIsVerified)) {
                    $sStatus  = 'success';
                    $sMessage = '"' . $sEmail . '" was added successfully. ';
                } else {
                    $sStatus  = 'error';
                    $sMessage = 'Failed to add email. ';
                    $sMessage .= $oUserModel->lastError();
                }
                break;

            case 'delete':
                if ($oUserModel->emailDelete($sEmail, $iId)) {
                    $sStatus  = 'success';
                    $sMessage = '"' . $sEmail . '" was deleted successfully. ';
                } else {
                    $sStatus  = 'error';
                    $sMessage = 'Failed to delete email "' . $sEmail . '". ';
                    $sMessage .= $oUserModel->lastError();
                }
                break;

            case 'makePrimary':
                if ($oUserModel->emailMakePrimary($sEmail, $iId)) {
                    $sStatus  = 'success';
                    $sMessage = '"' . $sEmail . '" was set as the primary email.';
                } else {
                    $sStatus  = 'error';
                    $sMessage = 'Failed to mark "' . $sEmail . '" as the primary address. ';
                    $sMessage .= $oUserModel->lastError();
                }
                break;

            case 'verify':
                //  Get the code for this email
                $aUserEmails = $oUserModel->getEmailsForUser($iId);
                $sCode       = '';

                foreach ($aUserEmails as $oUserEmail) {
                    if ($oUserEmail->email == $sEmail) {
                        $sCode = $oUserEmail->code;
                    }
                }

                if (!empty($sCode) && $oUserModel->emailVerify($iId, $sCode)) {
                    $sStatus  = 'success';
                    $sMessage = '"' . $sEmail . '" was verified successfully.';
                } elseif (empty($sCode)) {
                    $sStatus  = 'error';
                    $sMessage = 'Failed to mark "' . $sEmail . '" as verified. ';
                    $sMessage .= 'Could not determine email\'s security code.';
                } else {
                    $sStatus  = 'error';
                    $sMessage = 'Failed to mark "' . $sEmail . '" as verified. ';
                    $sMessage .= $oUserModel->lastError();
                }
                break;

            default:
                $sStatus  = 'error';
                $sMessage = 'Unknown action: "' . $action . '"';
                break;
        }

        $oSession = Factory::service('Session', 'nails/module-auth');
        $oSession->setFlashData($sStatus, $sMessage);
        redirect($oInput->post('return'));
    }
280202
def execute(self, email):
        """"""
        print('Sign up user {0}'.format(email))
        self.email_sender.send(email, 'Welcome, "{}"'.format(email))
288475
def send_security_email(data):
    
    msg = Message()
    msg.__dict__.update(data)
    current_app.extensions['mail'].send(msg)
55948
def send(self):
        
        if self.content_type.name == 'node':
            to = [self.to.user.email]
        elif self.content_type.name == 'layer':
            to = [self.to.email]
            # layer case is slightly special, mantainers need to be notified as well
            # TODO: consider making the mantainers able to switch off notifications
            for mantainer in self.to.mantainers.all().only('email'):
                to += [mantainer.email]
        else:
            to = [self.to.email]

        context = {
            'sender_name': self.from_name,
            'sender_email': self.from_email,
            'message': self.message,
            'site': settings.SITE_NAME,
            'object_type': self.content_type.name,
            'object_name': str(self.to)
        }
        message = render_to_string('mailing/inward_message.txt', context)

        email = EmailMessage(
            # subject
            _('Contact request from %(sender_name)s - %(site)s') % context,
            # message
            message,
            # from
            settings.DEFAULT_FROM_EMAIL,
            # to
            to,
            # reply-to header
            headers={'Reply-To': self.from_email}
        )

        import socket
        # try sending email
        try:
            email.send()
            self.status = 1
        # if error
        except socket.error as e:
            # log the error
            import logging
            log = logging.getLogger(__name__)
            error_msg = 'nodeshot.community.mailing.models.inward.send(): %s' % e
            log.error(error_msg)
            # set status of the instance as "error"
            self.status = -1
1228003
def send_mail(subject, message, from_email, recipient_list, html_message='',
              scheduled_time=None, headers=None, priority=PRIORITY.medium):
    

    subject = force_text(subject)
    status = None if priority == PRIORITY.now else STATUS.queued
    emails = []
    for address in recipient_list:
        emails.append(
            Email.objects.create(
                from_email=from_email, to=address, subject=subject,
                message=message, html_message=html_message, status=status,
                headers=headers, priority=priority, scheduled_time=scheduled_time
            )
        )
    if priority == PRIORITY.now:
        for email in emails:
            email.dispatch()
    return emails
964133
def send_mail(self, event):
        """"""

        mime_mail = MIMEText(event.text)
        mime_mail['Subject'] = event.subject

        if event.account == 'default':
            account_name = self.config.default_account
        else:
            account_name = event.account

        account = list(filter(lambda account: account['name'] == account_name, self.config.accounts))[0]

        mime_mail['From'] = render(account['mail_from'], {'server': account['server'], 'hostname': self.hostname})
        mime_mail['To'] = event.to_address

        self.log('MimeMail:', mime_mail, lvl=verbose)
        if self.config.mail_send is True:
            self.log('Sending mail to', event.to_address)

            self.fireEvent(task(send_mail_worker, account, mime_mail, event), "mail-transmit-workers")
        else:
            self.log('Not sending mail, here it is for debugging info:', mime_mail, pretty=True)