EmailAttachment class base

Represents a file attachment to include with an outgoing email.

Example:

final attachment = EmailAttachment(
  name: 'report.pdf',
  content: pdfBytes,
  contentType: 'application/pdf',
);

Constructors

EmailAttachment({required String name, required Uint8List content, String contentType = 'application/octet-stream'})
Creates an email attachment from in-memory bytes.
EmailAttachment.fromFile(File file, {String? customName})
Creates an attachment by reading the contents of a File.

Properties

content Uint8List
Attachment contents as raw bytes.
final
contentType String
MIME content type for the attachment.
final
hashCode int
The hash code for this object.
no setterinherited
name String
Attachment filename presented to the recipient.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited