Mailer class

Default implementation of MailerInterface.

Provides a fluent API for building and sending emails.

Implemented types

Constructors

Mailer(TransportInterface _transport, {QueueManager? queueManager, MailAddress? defaultFrom})

Properties

driverName String
Gets the underlying transport/driver name.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

attach(String path, {String? name, String? mimeType}) MailerInterface
Attaches a file to the email.
override
attachData(List<int> data, String name, {String? mimeType}) MailerInterface
Attaches raw data as a file.
override
bcc(dynamic addresses) MailerInterface
Sets the BCC (Blind Carbon Copy) recipient(s).
override
cc(dynamic addresses) MailerInterface
Sets the CC (Carbon Copy) recipient(s).
override
embed(String path, String cid) MailerInterface
Embeds an inline image in the email.
override
from(String address, [String? name]) MailerInterface
Sets the email sender (from address).
override
Sets a custom header.
override
html(String content) MailerInterface
Sets the HTML body of the email.
override
message() MailMessageInterface
Creates a new message builder.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
priority(int priority) MailerInterface
Sets the email priority.
override
queue([Duration? delay]) Future<void>
Queues the email for asynchronous sending.
override
queueMailable(Mailable mailable, [Duration? delay]) Future<void>
Queues a Mailable instance.
override
replyTo(String address, [String? name]) MailerInterface
Sets the reply-to address.
override
send() Future<bool>
Sends the email immediately.
override
sendMailable(Mailable mailable) Future<bool>
Sends a Mailable instance.
override
subject(String subject) MailerInterface
Sets the email subject.
override
text(String content) MailerInterface
Sets the plain text body of the email.
override
to(dynamic addresses) MailerInterface
Sets the recipient(s) of the email.
override
toString() String
A string representation of this object.
inherited
view(String viewName, [Map<String, dynamic>? data]) Future<MailerInterface>
Renders a view template for the email body.
override

Operators

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