Setup mail values
518141
public function setupMail()
    {
        if ($this->options === null) {
            throw new NullValueException('Mail options not set on ' . get_class($this));
        }

        $params = ['to', 'from', 'cc', 'bcc', 'replyTo', 'subject'];

        foreach ($params as $param) {
            if (isset($this->options->$param)) {
                $this->$param($this->options->$param);
            }
        }

        if ($this->options->markdown === true) {
            $this->markdown($this->options->view, $this->options->extraViewData ?? []);
        } else {
            $this->view($this->options->view, $this->options->extraViewData ?? []);
        }

        if ($this->options->textView !== null) {
            $this->text($this->options->textView, $this->options->textExtraViewData ?? []);
        }

        if ($this->options->attachments !== null) {
            if (isset($this->options->attachments['file'])) {
                $this->attach($this->options->attachments['file'], $this->options->attachments['options'] ?? []);
            } else {
                foreach ($this->options->attachments as $id => $attachment) {
                    $this->attach($attachment['file'], $attachment['options'] ?? []);
                }
            }
        }

        if ($this->options->rawAttachments !== null) {
            if (isset($this->options->rawAttachments['data'])) {
                $this->attachData(
                    $this->options->rawAttachments['data'],
                    $this->options->rawAttachments['name'],
                    $this->options->rawAttachments['options'] ?? []
                );
            } else {
                foreach ($this->options->rawAttachments as $id => $attachment) {
                    $this->attachData($attachment['data'], $attachment['name'], $attachment['options'] ?? []);
                }
            }
        }
    }
951978
def email(email_address):
    """"""
    if not email_address:
        click.secho(dtool_config.utils.get_user_email(CONFIG_PATH))
    else:
        click.secho(dtool_config.utils.set_user_email(
            CONFIG_PATH,
            email_address
        ))
408594
protected function build()
    {
        $mail = clone $this;
        $mail->setHeader('Message-ID', $this->getRandomId());

        $cursor = $mail;
        if ($mail->attachments) {
            $tmp = $cursor->setContentType('multipart/mixed');
            $cursor = $cursor->addPart();
            foreach ($mail->attachments as $value) {
                $tmp->addPart($value);
            }
        }

        if ($mail->htmlBody !== '') {
            $tmp = $cursor->setContentType('multipart/alternative');
            $cursor = $cursor->addPart();
            $alt = $tmp->addPart();
            if ($mail->inlines) {
                $tmp = $alt->setContentType('multipart/related');
                $alt = $alt->addPart();
                foreach ($mail->inlines as $value) {
                    $tmp->addPart($value);
                }
            }
            $alt->setContentType('text/html', 'UTF-8')
                ->setEncoding(\preg_match('#[^\n]{990}#', $mail->htmlBody)
                    ? self::ENCODING_QUOTED_PRINTABLE
                    : (\preg_match('#[\x80-\xFF]#', $mail->htmlBody) ? self::ENCODING_8BIT : self::ENCODING_7BIT))
                ->setBody($mail->htmlBody);
        }

        $text = $mail->getBody();
        $mail->setBody('');
        $cursor->setContentType('text/plain', 'UTF-8')
            ->setEncoding(\preg_match('#[^\n]{990}#', $text)
                ? self::ENCODING_QUOTED_PRINTABLE
                : (\preg_match('#[\x80-\xFF]#', $text) ? self::ENCODING_8BIT : self::ENCODING_7BIT))
            ->setBody($text);

        return $mail;
    }
22641
protected function _setup()
    {
        foreach ($this->_properties as $property) {
            $element = $this->_createElement($property);
            if ($element) {
                $this->addElement($element['name'], $element);
            }
        }
        $this->add(
            new Submit(
                ['value' => 'Save']
            )
        );
    }
645553
public function setPHPMail ()
    {

        // Set PHP mode

        $this->_useStream	= FALSE;

        // Change NL to single \n if we're using Qmail

        if (isset ($_SERVER['QMAIL']))
        {
            $this->_nl	= "\n";
        }
        else
        {
            $this->_nl	= "\r\n";
        }

    }
564110
function setReplyTo( $email, $name = false )
    {
        $this->Mail->setHeader( 'Reply-To', new ezcMailAddress( $email, $name, $this->usedCharset() ) );
        $this->ReplyTo = array( 'name' => $name,
                                'email' => $email );
    }
44797
function EmailForm(options) {

        /**
         * ### EmailForm.onsubmit
         *
         * Options passed to `getValues` when the submit button is pressed
         *
         * @see Feedback.getValues
         */
        if (!options.onsubmit) {
            this.onsubmit = {
                emailOnly: true,
                send: true,
                updateUI: true
            };
        }
        else if ('object' === typeof options.onsubmit) {
            this.onsubmit = options.onsubmit;
        }
        else {
            throw new TypeError('EmailForm constructor: options.onsubmit ' +
                                'must be string or object. Found: ' +
                                options.onsubmit);
        }

        /**
         * ### EmailForm._email
         *
         * Internal storage of the value of the email
         *
         * This value is used when the form has not been created yet
         *
         * @see EmailForm.createForm
         */
        this._email = options.email || null;

        /**
         * ### EmailForm.attempts
         *
         * Invalid emails tried
         */
        this.attempts = [];

        /**
         * ### EmailForm.timeInput
         *
         * Time when the email was inserted (first character, last attempt)
         */
        this.timeInput = null;

        /**
         * ### EmailForm.formElement
         *
         * The email's HTML form
         */
        this.formElement = null;

        /**
         * ### EmailForm.inputElement
         *
         * The email's HTML input form
         */
        this.inputElement = null;

        /**
         * ### EmailForm.buttonElement
         *
         * The email's HTML submit button
         */
        this.buttonElement = null;

        /**
         * ### EmailForm.setMsg
         *
         * If TRUE, a set message is sent instead of a data msg
         *
         * Default: FALSE
         */
        this.setMsg = !!options.setMsg || false;
    }
946003
def send_email(self, message):
        """"""
        msg = MIMEMultipart()
        msg['From'] = self.from_address
        msg['To'] = self.to_address
        msg['Subject'] = self.title
        msg.attach(MIMEText('<pre>' + cgi.escape(message) + '</pre>', 'html'))
        smtp = smtplib.SMTP(self.server, self.port,
                            timeout=self.timeout)
        if self.tls_auth:
            smtp.starttls()
            smtp.login(self.user, self.password)
        smtp.sendmail(self.from_address, self.to_address, msg.as_string())
        smtp.quit()
876419
private function configureMailSettings ()
    {
        $this->comment ('Configure mail driver settings');

        $choice = $this->choice ("Choose MAIL DRIVER. [log|mandrill|mailgun|sparkpost|set_up_later]", ['log', 'mailgun', 'mandrill', 'sparkpost', 'set_up_later'], 0);

        switch ($choice) {

            case 'log' :
                $this->envData['MAIL_DRIVER'] = 'log';

                break;

            case 'mandrill' :
                $this->envData['MAIL_DRIVER']     = 'mandrill';
                $this->envData['MANDRILL_SECRET'] = $this->ask ("Mandrill secret code: ") . "\n\n";

                break;

            case 'mailgun' :
                $this->envData['MAIL_DRIVER']    = 'mailgun';
                $this->envData['MAILGUN_DOMAIN'] = $this->ask ("Mailgun domain: ");
                $this->envData['MAILGUN_SECRET'] = $this->ask ("Mailgun secret: ") . "\n\n";

                break;

            case 'sparkpost' :
                $this->envData['MAIL_DRIVER']      = 'sparkpost';
                $this->envData['SPARKPOST_SECRET'] = $this->ask ("Sparkpost secret: ") . "\n\n";

                break;

            default:
                break;
        }
    }
328672
function set_user_data($id, $email=null, $data=[])
    {
        $user = array('id' => $id);
        if (isset($email)) {
            $user['email'] = $email;
        }
        $this->user_context(array_merge($user, $data));
    }
1242674
def process_email(ctx, param, value):
    """"""
    user = User.query.filter(User.email == value).first()
    if not user:
        raise click.BadParameter('User with email \'%s\' not found.', value)
    return user
1372822
private function setCC()
    {
        $cc = $this->mailable->get('_cc');

        if (!is_null($cc)) {
            foreach ($cc as $mail) {
                $this->message->setCC($mail);
            }
        }
    }
925679
protected void configure(Properties properties) {
        _properties = properties;
        _recipients = properties.getProperty("mail.smtp.to").split(" *[,;] *");
        _authenticator = new Authenticator() {
            protected PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication(_properties.getProperty("mail.smtp.user"), _properties.getProperty("mail.smtp.pass"));
            }
        };
    }
1177686
def add(self, email_address, name):
        """"""
        body = {
            "EmailAddress": email_address,
            "Name": name}
        response = self._post("/admins.json", json.dumps(body))
        return json_to_py(response)
580232
private static function mail()
    {
        $files = ['Mail', 'Mailable', 'SMTP'];
        $folder = static::$root.'Mailing'.'/';

        self::call($files, $folder);

        $files = ['SmtpParameterNotFoundException', 'MailViewNotFoundException'];
        $folder = $folder.'Exceptions/';

        self::call($files, $folder);
    }
831189
protected function _setEmail($varName, $email, $name)
    {
        if (!is_array($email)) {
            $this->_validateEmail($email, $varName);
            if ($name === null) {
                $name = $email;
            }
            $this->{$varName} = [$email => $name];

            return $this;
        }
        $list = [];
        foreach ($email as $key => $value) {
            if (is_int($key)) {
                $key = $value;
            }
            $this->_validateEmail($key, $varName);
            $list[$key] = $value;
        }
        $this->{$varName} = $list;

        return $this;
    }
723007
def setup_user_email(request, user, addresses):
    
    from .models import EmailAddress

    assert not EmailAddress.objects.filter(user=user).exists()
    priority_addresses = []
    # Is there a stashed e-mail?
    adapter = get_adapter(request)
    stashed_email = adapter.unstash_verified_email(request)
    if stashed_email:
        priority_addresses.append(EmailAddress(user=user,
                                               email=stashed_email,
                                               primary=True,
                                               verified=True))
    email = user_email(user)
    if email:
        priority_addresses.append(EmailAddress(user=user,
                                               email=email,
                                               primary=True,
                                               verified=False))
    addresses, primary = cleanup_email_addresses(
        request,
        priority_addresses + addresses)
    for a in addresses:
        a.user = user
        a.save()
    EmailAddress.objects.fill_cache_for_user(user, addresses)
    if (primary and email and email.lower() != primary.email.lower()):
        user_email(user, primary.email)
        user.save()
    return primary