attachData method

  1. @override
MailerInterface attachData(
  1. List<int> data,
  2. String name, {
  3. String? mimeType,
})
override

Attaches raw data as a file.

data is the file content as bytes. name is the attachment filename. mimeType is the MIME type of the attachment.

Implementation

@override
MailerInterface attachData(
  List<int> data,
  String name, {
  String? mimeType,
}) {
  _message.addAttachment(
    MailAttachment(
      data: data,
      filename: name,
      mimeType: mimeType ?? 'application/octet-stream',
    ),
  );
  return this;
}