public static function setDefaultDriver(Rhymix\Framework\Drivers\MailInterface $driver): void
Set the default driver.
public static function getDefaultDriver(): Rhymix\Framework\Drivers\MailInterface
Get the default driver.
public static function addDriver(Rhymix\Framework\Drivers\MailInterface $driver): void
Add a custom mail driver.
public static function getSupportedDrivers(): array
Get the list of supported mail drivers.
public function __construct()
The constructor.
public function setFrom(
string $email,
?string $name = null
): bool
Set the sender (From:).
public function getFrom(): ?string
Get the sender (From:).
public function addTo(
string $email,
?string $name = null
): bool
Add a recipient (To:).
public function addCc(
string $email,
?string $name = null
): bool
Add a recipient (CC:).
public function addBcc(
string $email,
?string $name = null
): bool
Add a recipient (BCC:).
public function getRecipients(): array
Get the list of recipients.
public function setReplyTo(string $replyTo): bool
Set the Reply-To: address.
public function setReturnPath(string $returnPath): bool
Set the Return-Path: address.
public function setMessageID(string $message_id): bool
Set the Message ID.
public function setInReplyTo(string $in_reply_to): bool
Set the In-Reply-To: header.
public function setReferences(string $references): bool
Set the References: header.
public function setSubject(string $subject): bool
Set the subject.
public function getSubject(): string
Get the subject.
public function setTitle(string $subject): bool
Set the subject (alias to setSubject).
public function getTitle(): string
Get the subject (alias to getSubject).
public function setBody(
string $content,
?string $content_type = null
): void
Set the body content.
public function getBody(): string
Get the body content.
public function setContent(
string $content,
?string $content_type = null
): void
Set the body content (alias to setBody).
public function getContent(): string
Get the body content (alias to getBody).
public function setContentType(string $type = 'text/html'): void
Set the content type.
public function getContentType(): string
Get the content type.
public function attach(
string $local_filename,
?string $display_filename = null
): bool
Attach a file.
public function embed(
string $local_filename,
?string $cid = null
)
Embed a file.
public function getAttachments(): array
Get the list of attachments to this message.
public function send(bool $sync = false): bool
Send the email.
public static function sendAsync(self $mail): void
Send an email asynchronously (for Queue integration).
public function isSent(): bool
Check if the message was sent.
public function getCaller(): string
Get caller information.
public function getErrors(): array
Get errors.