sendMessageText method

Future<SmtpResponse> sendMessageText(
  1. String text,
  2. MailAddress from,
  3. List<MailAddress> recipients, {
  4. bool use8BitEncoding = false,
})

Sends the specified message text from to the recipients.

In contrast to the other methods the text is not modified apart from the SMTP transparency procedure (RFC 5321 section 4.5.2), i.e. every line starting with a period gets an additional leading period. Set use8BitEncoding to true for sending a UTF-8 encoded message body.

Implementation

Future<SmtpResponse> sendMessageText(
  String text,
  MailAddress from,
  List<MailAddress> recipients, {
  bool use8BitEncoding = false,
}) {
  final recipientEmails = recipients.map((r) => r.email).toList();
  _checkEnvelope(from.email, recipientEmails);

  return sendCommand(
    SmtpSendMailTextCommand(
      text,
      from,
      recipientEmails,
      use8BitEncoding: use8BitEncoding,
    ),
  );
}