embed method

  1. @override
MailerInterface embed(
  1. String path,
  2. String cid
)
override

Embeds an inline image in the email.

path is the image file path. cid is the Content-ID to reference in HTML (e.g., 'logo').

In HTML:

Implementation

@override
MailerInterface embed(String path, String cid) {
  final file = File(path);
  if (!file.existsSync()) {
    throw MailException('Embed file not found: $path');
  }

  _message.addEmbedded(
    MailEmbedded(
      path: path,
      cid: cid,
    ),
  );
  return this;
}