Helper function to add original email address
To the DEV email so engineers can see who it would
Have been sent to

@param {String} devEmail
@param {String} email
15828
function getOverriddenEmail(email: string): string {
  if (!cfg.email.devEmail) {
    throw new Error("Email failed to send: cfg.email.devEmail is not set");
  }
  const devEmailParts = cfg.email.devEmail.split("@");
  return `${devEmailParts[0]}+${email.replace("@", ".at.")}@${
    devEmailParts[1]
  }`;
}
849853
def get_email(self):
        
        api_url = self.api_url + "/events/public"
        api_content = GithubRawApi(
            api_url,
            get_api_content_now=True
        ).api_content

        for event in api_content:
            if event["type"] == "PushEvent":
                return event["payload"]["commits"][0]["author"]["email"]
536616
private function updateDefaultDatafields($email, $websiteId)
    {
        $website = $this->helper->storeManager->getWebsite($websiteId);
        $this->helper->updateDataFields($email, $website, $this->storeName);
    }
1011850
function encodeEmail_debutpage($email, $name = null)
    {

        $email = preg_replace("/\"/", "\\\"", $email);

        if ($name == null) {
            $name = $email;
        }

        $old = "document.write('<a CLASS=infoacceuil ".
            "href=\"mailto:$email\">$name</a>')";

        $output = "";

        for ($i=0; $i < pia_strlen($old); $i++) {
            $output = $output . '%' . bin2hex(pia_substr($old, $i, 1));
        }

        $output = '<script type="text/javascript">eval(unescape(\''.
            $output.'\'))</script>';
        $output .= '<noscript><div>Vous devez accepter le Javascript'.
            ' pour voir l\'email</div></noscript>';
        return $output;
    }
837875
def add_email_address(self, email, hidden=None):
        
        existing_emails = get_value(self.obj, 'email_addresses', [])
        found_email = next(
            (existing_email for existing_email in existing_emails if existing_email.get('value') == email),
            None
        )
        if found_email is None:
            new_email = {'value': email}
            if hidden is not None:
                new_email['hidden'] = hidden
            self._append_to('email_addresses', new_email)
        elif hidden is not None:
            found_email['hidden'] = hidden
466926
public void checkEmail(String email) throws CmsIllegalArgumentException {

        if (CmsStringUtil.isNotEmpty(email)) {
            email = email.trim();
            email = email.toLowerCase(Locale.ROOT);
        }
        if (!CmsStringUtil.validateRegex(email, EMAIL_REGEX, false)) {
            throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_EMAIL_VALIDATION_1, email));
        }
    }
546817
public void addEmail(String newEmail) {
        Assert.hasText(newEmail, "Attempted to add null or empty email string to user.");

        if (emails == null) {
            emails = new ArrayList<>(1);
        }
        for (Email email : emails) {
            if (email.value.equals(newEmail)) {
                throw new IllegalArgumentException("Already contains email " + newEmail);
            }
        }

        Email e = new Email();
        e.setValue(newEmail);
        emails.add(e);
    }
1015095
function buildEmail(envelope, data) {
  return simpleParser(data)
    .then(function(parsedEmail) {
      const sender    = envelope.mailFrom.address;
      const receivers = envelope.rcptTo
        .map(recipient => [ recipient.address, true ])
        .reduce(tupleToObject, {});

      const headers   = [ ... parsedEmail.headers ]
        .map(readHeader)
        .reduce(tupleToObject, {});

      const email     = {
        sender,
        receivers,
        data,
        headers,
        body:      parsedEmail.text,
        html:      parsedEmail.html,
        attachments:      parsedEmail.attachments
      };

      return email;
    });
}
1269207
public function send($email = 0)
    {

        if ($email instanceof Email) {
            $this->addEmailToOutbox($email);
        }

        $sent_emails = 0;

        foreach ($this->emails as &$email) {
            
            //all email goes to DEBUG_EMAIL if specified
            if (defined("DEBUG_EMAIL")) {
                $email->debug_info = "\n\nDEBUG MODE: Should be sent to: " . $email->to . " when not in debug mode!";
                $email->debug_info .= "\nDEBUG MODE: Should be sent from: " . $email->from . " when not in debug mode!";

                $email->to = \DEBUG_EMAIL;
                $email->from = \DEBUG_EMAIL;

                if (!empty($email->cc)) {
                    $email->debug_info .= "\nDEBUG MODE: Should be be CCed to: "
                        . implode(", ", $email->cc) . " when not in debug mode!";
                    $email->cc = Array();
                }

                if (!empty($email->bcc)) {
                    $email->debug_info .= "\nDEBUG MODE: Should be be BCCed to: "
                        . implode(", ", $email->bcc) . " when not in debug mode!";
                    $email->bcc = Array();
                }

                $email->body .= $email->debug_info;
                if (!empty($email->body_HTML)) {
                    $email->body_HTML .= nl2br($email->debug_info);
                }
            }
            $email->to = $email->to ? $email->to : null;
            $email->constructMultipartMessage();
            
            //sanitize sender params
            if(preg_match("~<(.*?)>~", $email->from, $match)){
                $sender = $match[1];
            } else {
                $sender = $email->from;
            }
      
            $sender = filter_var($sender, FILTER_SANITIZE_EMAIL);
            $params = sprintf('-f%s', escapeshellcmd($sender));
    
            if (mail($email->to, $email->subject, $email->body, $email->_header_text, $params)) {

                $email->sent = 1;
                $sent_emails++;

                $this->logEmail($email, true);
            } else {
                $this->logEmail($email, false);
            }
        }

        $emails_cnt = count($this->emails);

        $this->emails = Array();

        if ($sent_emails == $emails_cnt) {
            return true;
        } else {
            return false;
        }
    }
99910
def _send(self, email_message):
        """"""
        if not email_message.recipients():
            return False

        if set(email_message.recipients()).issubset(admin_emails()):
            # Skip on admin notifications
            return super(DevEmailBackend, self)._send(email_message)

        from_email = sanitize_address(email_message.from_email, email_message.encoding)
        try:
            recipients = [sanitize_address(addr, email_message.encoding)
                          for addr in settings.DEV_EMAIL_LIST]
        except:
            raise ImproperlyConfigured("You must set a DEV_EMAIL_LIST setting to use the Dev Email Backend.")

        message = email_message.message()
        charset = message.get_charset().get_output_charset() if message.get_charset() else "utf-8"
        try:
            self.connection.sendmail(from_email, recipients,
                                     force_bytes(message.as_string(), charset))
        except:
            if not self.fail_silently:
                raise
            return False
        return True
371483
function locallookup (email) {
  let keys = keyring.publicKeys.getForAddress(email)
  if (keys.length === 0) {
    return null
  }
  // keys[0].toString = printKey
  return keys[0]
}
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)
1346244
protected function _onEmailChange($email, $updateOrInsert = 'insert') {
        $authVars = Garp_Auth::getInstance()->getConfigValues('validateemail');

        // See if validation of email is enabled
        if (empty($authVars['enabled']) || !$authVars['enabled']) {
            return;
        }
        $validationTokenColumn = $authVars['token_column'];
        $emailValidColumn = $authVars['email_valid_column'];

        // Fetch fresh user data by email
        $users = $this->fetchAll(
            $this->select()->from(
                $this->getName(),
                array('id', 'email', $validationTokenColumn, $emailValidColumn)
            )
                ->where('email = ?', $email)
        );

        // Generate validation token for all the found users
        foreach ($users as $user) {
            $this->invalidateEmailAddress($user, $updateOrInsert);
        }
    }
1320490
protected function _addAddress($email, $name, $type) {

        $type = '_'.$type;

        $allowed = array(
            '_sender',
            '_from',
            '_to',
            '_cc',
            '_bcc',
            '_reply_to'
        );

        if (in_array($type, $allowed)) {
            if ($name != '') {
                $this->{$type}[$email] = $name;
            } else {
                $this->{$type}[] = $email;
            }
        }
    }
753270
function mail() {
  var awsURL = !!CONFIG && !!CONFIG.aws && !!CONFIG.aws.url ? CONFIG.aws.url : false;

  if (EMAIL) {
    CONFIG.mail.to = [EMAIL];
  }

  return gulp.src('dist/**/*.html')
    .pipe($.if(!!awsURL, $.replace(/=('|")(\/?assets\/img)/g, "=$1"+ awsURL)))
    .pipe($.mail(CONFIG.mail))
    .pipe(gulp.dest('dist'));
}
598492
def get_email_address(whoami="user"):
    
    if whoami == "user":
        username = getusername()
        domain = getdomainname()

        myemail = "{0}@{1}".format(username, domain)
        return myemail
    else:
        fromaddr = "notifier-donotreply@{0}".format(getdomainname())
        return fromaddr
1266360
function send_to( $mail ) {
		$mail['subject'] .= ' [' . $mail['to'] . ']';

		if( 'staging' == WP_ENV )
			$mail['to'] = get_option( 'admin_email' );
		else if( defined( 'TP_DEV_MAIL' ) )
			$mail['to'] = TP_DEV_MAIL;
		else
			$mail['to'] = '';

		return $mail;
	}