Compose a message to this user.  Calls :meth:`narwal.Reddit.compose`.
        
        :param subject: subject of message
        :param text: body of message
976608
def message(self, subject, text):
        
        return self._reddit.compose(self.name, subject, text)
432337
def send_mail(subject, recipient, template, **context):
    

    config = current_app.config
    sender = config["MAIL_SENDER"]
    msg = Message(subject, sender=sender, recipients=[recipient])

    template_name = f"login/email/{template}.txt"
    msg.body = render_template_i18n(template_name, **context)
    # msg.html = render_template('%s/%s.html' % ctx, **context)

    mail = current_app.extensions.get("mail")
    current_app.logger.debug("Sending mail...")
    mail.send(msg)
1059186
def email_message(
        self,
        recipient,  # type: Text
        subject_template,  # type: Text
        body_template,  # type: Text
        sender=None,  # type: Optional[AbstractUser]
        message_class=EmailMessage,
        **kwargs
    ):
        
        from_email = "%s %s <%s>" % (
            sender.first_name,
            sender.last_name,
            email.utils.parseaddr(settings.DEFAULT_FROM_EMAIL)[1],
        )
        reply_to = "%s %s <%s>" % (sender.first_name, sender.last_name, sender.email)

        headers = {"Reply-To": reply_to}
        kwargs.update({"sender": sender, "recipient": recipient})

        subject_template = loader.get_template(subject_template)
        body_template = loader.get_template(body_template)

        subject = subject_template.render(
            kwargs
        ).strip()  # Remove stray newline characters

        body = body_template.render(kwargs)

        return message_class(subject, body, from_email, [recipient], headers=headers)
414192
public void sendMail (String to, String subject, String content) throws MessagingException {
        Properties props = new Properties();
        props.put("mail.smtp.user", emailConfg.getUser());
        props.put("mail.smtp.host", emailConfg.getHost());
        props.put("mail.smtp.port", emailConfg.getPort());
        props.put("mail.smtp.starttls.enable","true");
        props.put("mail.smtp.debug", emailConfg.getDebug());
        props.put("mail.smtp.auth", emailConfg.getAuth());
        props.put("mail.smtp.ssl.trust", emailConfg.host);

        SMTPAuthenticator auth = new SMTPAuthenticator(emailConfg.getUser(), (String)secret.get(SecretConstants.EMAIL_PASSWORD));
        Session session = Session.getInstance(props, auth);

        MimeMessage message = new MimeMessage(session);

        message.setFrom(new InternetAddress(emailConfg.getUser()));
        message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));

        message.setSubject(subject);

        message.setContent(content, "text/html");

        // Send message
        Transport.send(message);
        if(logger.isInfoEnabled()) logger.info("An email has been sent to " + to + " with subject " + subject);
    }
782886
def __make_message(self, topic, content):
        
        return {"uid": str(uuid.uuid4()).replace('-', '').upper(),
                "topic": topic,
                "content": content}
1083672
def send(
            self,
            *,
            text: str,
    ) -> List[OutputRecord]:
        
        try:
            status = self.api.status_post(status=text)

            return [TootRecord(record_data={
                "toot_id": status["id"],
                "text": text
            })]

        except mastodon.MastodonError as e:
            return [self.handle_error((f"Bot {self.bot_name} encountered an error when "
                                      f"sending post {text} without media:\n{e}\n"),
                                     e)]
281301
def send_text(self, text, **options):
        
        return self.bot.send_message(self.id, text, **options)
305150
def message_me(msg)
			@msg = msg
			mail from: @msg.email, subject: @msg.subject, body: @msg.content
		end
170222
def submit_text(self, title, text):
        
        return self._reddit.submit_text(self.display_name, title, text)
146714
def new_sent(self, text, ID=None, **kwargs):
        '''  '''
        if ID is None:
            ID = next(self.__idgen)
        return self.add_sent(Sentence(text, ID=ID, **kwargs))
268386
def say(text, quick_replies: [], user: @user)
      message_options = {
        recipient: { id: user.id },
        message: { text: text }
      }
      if quick_replies && !quick_replies.empty?
        message_options[:message][:quick_replies] = UI::QuickReplies
                                                      .build(*quick_replies)
      end

      send_message(message_options)
    end
470231
public void send(String subject, String body)
  {
    try {
      MimeMessage msg = new MimeMessage(getSession());

      if(_from.length > 0)
        msg.addFrom(_from);
      msg.addRecipients(RecipientType.TO, _to);
      if(subject != null)
        msg.setSubject(subject);
      msg.setContent(body, "text/plain");

      send(msg);
    } catch (RuntimeException e) {
      throw e;
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
1313388
def message_user(self, username, domain, subject, message):
        """"""
        jid = '%s@%s' % (username, domain)
        if self.api_version <= (14, 7):
            # TODO: it's unclear when send_message was introduced
            command = 'send_message_chat'
            args = domain, '%s@%s' % (username, domain), message
        else:
            command = 'send_message'
            args = 'chat', domain, jid, subject, message

        code, out, err = self.ctl(command, *args)
        if code != 0:
            raise BackendError(code)
1010226
public static void sendMessage(final Context context, final String subject, final String body, final String toAddress) {
        final Intent intent;
        if (toAddress != null && !"".equals(toAddress)) {
            intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", toAddress, null));
        } else {
            intent = new Intent(Intent.ACTION_SEND);
        }
        intent.setType("text/plain");
        if (subject != null && !"".equals(subject)) {
            intent.putExtra(Intent.EXTRA_SUBJECT, subject);
        }
        if (body != null && !"".equals(body)) {
            intent.putExtra(Intent.EXTRA_TEXT, body);
        }
        context.startActivity(Intent.createChooser(intent, "Send message..."));
    }
351113
def send_text(self, text):
        
        if not self.is_token_set:
            raise ValueError('TelepythClient: Access token is not set!')

        stream = StringIO()
        stream.write(text)
        stream.seek(0)

        return self(stream)
1270353
def subject(self):
        
        template_name = self.subject_template_name() if \
            callable(self.subject_template_name) \
            else self.subject_template_name
        subject = loader.render_to_string(
            template_name, self.get_context(), request=self.request
        )
        return ''.join(subject.splitlines())
881268
def send_message(self, author, content):
        
        if isinstance(author, Author) is False:
            raise ValueError('argument answer need to be Zhihu.Author object.')
        if not content:
            raise ValueError('answer content cannot be empty')
        if author.url == self.url:
                return False
        data = {
            'member_id': author.hash_id,
            'content': content,
            'token': '',
            '_xsrf': author.xsrf
        }
        res = self._session.post(Send_Message_Url,
                                 data=data)
        return res.json()['r'] == 0