sendChunkedMessageData method Null safety

Future<SmtpResponse> sendChunkedMessageData(
  1. MimeData data,
  2. MailAddress from,
  3. List<MailAddress> recipients,
  4. {bool use8BitEncoding = false}
)

Sends the specified message data from to the recipients using the BDAT SMTP command.

BDATA is supported when the SMTP server announces the CHUNKING capability in its EHLO response. You can query SmtpServerInfo.supportsChunking for this. Set use8BitEncoding to true for sending a UTF-8 encoded message body.

Implementation

Future<SmtpResponse> sendChunkedMessageData(
    MimeData data, MailAddress from, List<MailAddress> recipients,
    {bool use8BitEncoding = false}) {
  if (recipients.isEmpty) {
    throw SmtpException(this, SmtpResponse(['500 no recipients']));
  }
  return sendCommand(SmtpSendBdatMailDataCommand(
      data, use8BitEncoding, from, recipients.map((r) => r.email).toList()));
}