Sends email to me with this message

    :param sender: Sender of email
    :param msg: Message to send to me
    :param driver: GMail authenticator
542687
def send_email(sender, msg, driver):
    
    driver.users().messages().send(
        userId=sender,
        body=msg
    ).execute()
1350327
def send(self, sender: PytgbotApiBot):
        
        return sender.send_audio(
            # receiver, self.media, disable_notification=self.disable_notification, reply_to_message_id=reply_id
            audio=self.audio, chat_id=self.receiver, reply_to_message_id=self.reply_id, caption=self.caption, parse_mode=self.parse_mode, duration=self.duration, performer=self.performer, title=self.title, thumb=self.thumb, disable_notification=self.disable_notification, reply_markup=self.reply_markup
        )
959352
def sendmail_sync(
        self,
        sender: str,
        recipients: RecipientsType,
        message: Union[str, bytes],
        mail_options: Iterable[str] = None,
        rcpt_options: Iterable[str] = None,
        timeout: DefaultNumType = _default,
    ) -> SendmailResponseType:
        
        return self._run_sync(
            self.sendmail,
            sender,
            recipients,
            message,
            mail_options=mail_options,
            rcpt_options=rcpt_options,
            timeout=timeout,
        )
420346
def email_me(self, msg):
        
        logging.debug('Emailing myself')
        return self.email(self._credentials['PERSONAL_EMAIL'], msg)
102043
def send_mail(template, to, **kwargs):
    

    def cb():
        return mail.send(to=to, template=template, **kwargs)

    return signals.send_mail(cb, data={"to": to, "template": template, "kwargs": kwargs})
721544
def send_msg(self, msg):
        
        for receiver in msg.receivers:
            current_receiver = self.receivers.get(receiver, self.default_receiver)
            current_receiver.send_msg(msg)
287444
def send(self, message_id, args=[], kwargs={}):
        
        self._logger.debug('Send {} in stm {}'.format(message_id, self.id))
        self._driver._add_event(
            event_id=message_id, args=args, kwargs=kwargs, stm=self)
73221
def send(self, sender: PytgbotApiBot):
        
        return sender.send_document(
            # receiver, self.media, disable_notification=self.disable_notification, reply_to_message_id=reply_id
            document=self.document, chat_id=self.receiver, reply_to_message_id=self.reply_id, thumb=self.thumb, caption=self.caption, parse_mode=self.parse_mode, disable_notification=self.disable_notification, reply_markup=self.reply_markup
        )
63202
def send(self, sender: PytgbotApiBot):
        
        return sender.send_sticker(
            # receiver, self.media, disable_notification=self.disable_notification, reply_to_message_id=reply_id
            sticker=self.sticker, chat_id=self.receiver, reply_to_message_id=self.reply_id, disable_notification=self.disable_notification, reply_markup=self.reply_markup
        )
418881
def sendTemplate(mailer, sender, recipient, template, context, hook=_nop):
    
    headers, parts = template.evaluate(context)
    headers["From"] = sender
    headers["To"] = recipient
    hook(headers, parts)

    content = mime.buildMessage(headers, parts)
    return mailer.send(sender, recipient, content)
441454
def _send(self, message):
        
        if not self._running:
            self._connect()
            self.authenticate()
        message_dumped = json.dumps(message) + self.__CRLF
        try:
            self._socket.send(message_dumped.encode())
        except (socket.timeout, socket.error) as e:
            self.stop()
            raise SocketError('[Connect: %s]: Socket %s' % (self._unique_id, e))
1041115
def send(self, msg):
        ''''''
        app = self.app or current_app
        mailer = app.extensions['marrowmailer']
        mailer.start()
        if not hasattr(msg, '__iter__'):
            result = mailer.send(msg)
        else:
            result = map(lambda message: mailer.send(message), msg)
        mailer.stop()
        return result
1174473
def Emailer(recipients, sender=None):
    
    import smtplib
    hostname = socket.gethostname()
    if not sender:
        sender = 'lggr@{0}'.format(hostname)
    smtp = smtplib.SMTP('localhost')
    try:
        while True:
            logstr = (yield)
            try:
                smtp.sendmail(sender, recipients, logstr)
            except smtplib.SMTPException:
                pass
    except GeneratorExit:
        smtp.quit()
884094
def send(self, to, subject, body, reply_to=None, **kwargs):
        
        if self.provider == "SES":
            self.mail.send(to=to,
                           subject=subject,
                           body=body,
                           reply_to=reply_to,
                           **kwargs)
        elif self.provider == "FLASK-MAIL":
            msg = flask_mail.Message(recipients=to, subject=subject, body=body, reply_to=reply_to,
                                     sender=self.app.config.get("MAIL_DEFAULT_SENDER"))
            self.mail.send(msg)
1161285
def send_notification(self, user, sender=None, **kwargs):
        
        if not user.is_active:
            return False
        self.email_message(
            user, self.notification_subject, self.notification_body, sender, **kwargs
        ).send()
        return True
704953
def sendmail(self, to, message):
        

        # If we were passed a bare string as the To: address, convert it to
        # a single element list.
        if isinstance(to, str):
            to = [ to, ]

        # Send one email with the appropriate recipient list.
        server = self._smtp_server()
        server.sendmail(self.get_rfc2822_address(), to, message)
        server.quit()
139528
def send_email(recipients, subject, message, attachments=None):
    
    if not attachments:
        attachments = []

    if os.path.exists(EMAIL_SETTINGS_FILE):
        email_settings = json.load(open(EMAIL_SETTINGS_FILE))
        sender = email_settings.get('sender', 'ambry@localhost')
        use_tls = email_settings.get('use_tls')
        username = email_settings['username']
        password = email_settings['password']
        server = email_settings['server']
    else:
        # use local smtp
        server = 'localhost'
        username = None
        password = None
        sender = 'ambry@localhost'

    # Create the container (outer) email message.
    msg = MIMEMultipart()
    msg['Subject'] = subject
    msg['From'] = sender
    msg['To'] = ','.join(recipients)
    msg.attach(MIMEText(message, 'plain'))

    # Add attachments.
    for file_name in attachments:
        if os.path.exists(file_name):
            with open(file_name, 'r') as fp:
                attachment = MIMEBase('application', 'text')
                attachment.set_payload(fp.read())
                attachment.add_header(
                    'Content-Disposition',
                    'attachment; filename="{}"'.format(os.path.basename(file_name)))
                msg.attach(attachment)

    # The actual mail send.
    srv = smtplib.SMTP(server)
    if use_tls:
        srv.starttls()
    if username:
        srv.login(username, password)

    srv.sendmail(sender, ','.join(recipients), msg.as_string())
    srv.quit()