Quickly send an email to yourself. Calls :py:meth:`email`.
        
        * *stored credential name: PERSONAL_EMAIL*
        
        :param msg: The content of the email. See :py:meth:`gmail_email`.
420346
def email_me(self, msg):
        
        logging.debug('Emailing myself')
        return self.email(self._credentials['PERSONAL_EMAIL'], msg)
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
919241
def send_verification_email(self, body):
        
        return self.client.post(self._url('verification-email'), data=body)
217893
def send_message(self, message, all_credentials):
        
        _, data, max_doc_size = self._split_message(message)
        with self.get_socket(all_credentials) as sock_info:
            sock_info.send_message(data, max_doc_size)
1086926
def send_email(self):
        
        # send only if user notification setting is set to true
        if self.check_user_settings():
            send_mail(_(self.type), self.email_message, settings.DEFAULT_FROM_EMAIL, [self.to_user.email])
            return True
        else:
            # return false otherwise
            return False
663954
def contact(msg)
      @data = {
          msg: msg,
          client_ip: msg.remote_ip,
          gems: BarkestCore.gem_list(Rails.application.class.parent_name.underscore, 'rails', 'barkest*'),
      }
      mail subject: msg.full_subject, reply_to: msg.your_email
    end
786684
def send_email(self, user, subject, msg):
        """"""
        print('To:', user)
        print('Subject:', subject)
        print(msg)
1012749
def sendCommand(self, **msg):
		
		assert 'type' in msg, 'Message type is required.'

		msg['id'] = self.next_message_id
		self.next_message_id += 1

		if self.next_message_id >= maxint:
			self.next_message_id = 1

		self.sendMessage(json.dumps(msg))
		return msg['id']
984735
def run(self, args):
        
        email = args.email                  # email of person to send email to
        username = args.username            # username of person to send email to, will be None if email is specified
        force_send = args.resend            # is this a resend so we should force sending
        auth_role = args.auth_role          # authorization role(project permissions) to give to the user
        msg_file = args.msg_file            # message file who's contents will be sent with the share
        message = read_argument_file_contents(msg_file)
        print("Sharing project.")
        to_user = self.remote_store.lookup_or_register_user_by_email_or_username(email, username)
        try:
            project = self.fetch_project(args, must_exist=True, include_children=False)
            dest_email = self.service.share(project, to_user, force_send, auth_role, message)
            print("Share email message sent to " + dest_email)
        except D4S2Error as ex:
            if ex.warning:
                print(ex.message)
            else:
                raise
1319837
def send(self, email, attachments=()):
        '''
        '''

        msg = email.as_mime(attachments)

        if 'From' not in msg:
            msg['From'] = self.sender_address()

        if self._conn:
            self._conn.sendmail(self.username, email.recipients,
                                msg.as_string())
        else:
            with self:
                self._conn.sendmail(self.username, email.recipients,
                                    msg.as_string())
971733
def send_msg(self, connection, data):
        
        # serialize as JSON
        msg = json.dumps(data)
        # Prefix each message with a 4-byte length (network byte order)
        msg = struct.pack('>I', len(msg)).decode() + msg
        connection.sendall(msg.encode())
        return
1047157
def send_mail(subject, message, recipient_list, from_email=None,
              fail_silently=False, auth_user=None, auth_password=None,
              connection=None, **kwargs):
    
    connection = connection or get_connection(
        username=auth_user,
        password=auth_password,
        fail_silently=fail_silently,
    )
    mail_message = EmailMessage(subject, message, from_email, recipient_list,
                                **kwargs)

    return connection.send_messages([mail_message])
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)
1017488
def send_activation_email(self, user):
        
        activation_key = self.get_activation_key(user)
        context = self.get_email_context(activation_key)
        context.update({
            'user': user
        })
        subject = render_to_string(self.email_subject_template,
                                   context)
        # Force subject to a single line to avoid header-injection
        # issues.
        subject = ''.join(subject.splitlines())
        message = render_to_string(self.email_body_template,
                                   context)
        user.email_user(subject, message, conf.get('DEFAULT_FROM_EMAIL'))
1046882
def mail_message(smtp_server, message, from_address, rcpt_addresses):
    
    if smtp_server[0] == '/':
        # Sending the message with local sendmail
        p = os.popen(smtp_server, 'w')
        p.write(message)
        p.close()
    else:
        # Sending the message using a smtp server
        import smtplib

        server = smtplib.SMTP(smtp_server)
        server.sendmail(from_address, rcpt_addresses, message)
        server.quit()
1240170
def email(to='medusa@sweeting.me', _from=default_from, subject='BOT MSG', message="Info email", attachments=None):
    """"""
    for attachment in attachments or []:
        filename = attachment.strip()
        try:
            result = run_cmd('uuencode %s %s | mailx -s "%s" %s' % (filename, filename, subject, to))[0]
            return "Sending email From: %s; To: %s; Subject: %s; Attachment: %s (%s)" % (_from, to, subject, filename, result or 'Succeded')
        except Exception as error:
            return str(error)

    if not attachments:
        p = os.popen("/usr/sbin/sendmail -t", "w")
        p.write("From: %s\n" % _from)
        p.write("To: %s\n" % to)
        p.write("Subject: %s\n" % subject)
        p.write("\n")   # blank line separating headers from body
        p.write('%s\n' % message)
        result = p.close()

    if not result:
        return "Sent email From: %s; To: %s; Subject: %s; Attachments: %s)" % (_from, to, subject, ','.join(attachments or []))
    else:
        return "Error: %s. Please fix Postfix:\n %s" % (result, help_str)
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()