Skip to content

QubusMailer

Properties

templatePath

protected ?string $templatePath

config

protected \Qubus\Config\ConfigContainer $config

Methods

__construct

public __construct(\Qubus\Config\ConfigContainer $config): mixed

Parameters:

Parameter Type Description
$config \Qubus\Config\ConfigContainer

withFrom

Set the From and FromName properties.

public withFrom(string $address, string $name = '', bool $auto = true): static

Parameters:

Parameter Type Description
$address string
$name string
$auto bool Whether to also set the Sender address, defaults to true.

withTo

Add a "To" address.

public withTo(string|array $address): static

Parameters:

Parameter Type Description
$address string|array The email address(es) to send to.

withCc

Add a "CC" address.

public withCc(string|array $address): static

Parameters:

Parameter Type Description
$address string|array The email address(es) to send to.

withBcc

Add a "BCC" address.

public withBcc(string|array $address): static

Parameters:

Parameter Type Description
$address string|array The email address(es) to send to.

withReplyTo

Add a "Reply-To" address.

public withReplyTo(string|array $address): static

Parameters:

Parameter Type Description
$address string|array The email address(es) to reply to.

withAddresses

private withAddresses(string $type, mixed $addresses): bool

Parameters:

Parameter Type Description
$type string Type of the recipient (to, cc, bcc or Reply-To)
$addresses mixed Email address or array of email addresses.

Return Value:

True on success, false if addresses not valid.

Throws:


withSender

The envelope sender of the message.

public withSender(string $sender = ''): static

Parameters:

Parameter Type Description
$sender string

withSubject

The Subject of the message.

public withSubject(string $subject = ''): static

Parameters:

Parameter Type Description
$subject string

withHtml

Sets message type to HTML or plaintext.

public withHtml(bool $isHtml = false): static

Parameters:

Parameter Type Description
$isHtml bool True for HTML mode.

withPriority

Email priority.

public withPriority(?int $priority = null): static

Parameters:

Parameter Type Description
$priority ?int

withCharset

The character set of the message.

public withCharset(string $charset = self::CHARSET_ISO88591): static

Parameters:

Parameter Type Description
$charset string The character set of the message.

withCustomHeader

Add a custom header.

public withCustomHeader(string $name, ?string $value = null): static

Parameters:

Parameter Type Description
$name string Custom header name.
$value ?string Header value.

withContentType

The MIME Content-type of the message.

public withContentType(string $contentType = self::CONTENT_TYPE_PLAINTEXT): static

Parameters:

Parameter Type Description
$contentType string

withAttachment

Add an attachment from a path on the filesystem.

public withAttachment(string $path, string $name = '', string $encode = self::ENCODING_BASE64, string $type = '', string $disposition = 'attachment'): static

Parameters:

Parameter Type Description
$path string Path to the attachment
$name string Overrides the attachment name
$encode string File encoding (see $Encoding)
$type string MIME type, e.g. image/jpeg; determined automatically from $path if not specified
$disposition string Disposition to use.

withBody

Set Mail Body configuration

public withBody(string|array $data, array $options = []): static

Parameters:

Parameter Type Description
$data string|array Contain the values to be parsed in mail body.
$options array Array of options.

withAltBody

The plain-text message body.

public withAltBody(string $message = ''): static

Parameters:

Parameter Type Description
$message string

withXMailer

What to put in the X-Mailer header.

public withXMailer(?string $xmailer = ''): static

Parameters:

Parameter Type Description
$xmailer ?string

withSmtp

Send messages using SMTP.

public withSmtp(): static

withMail

Send messages using PHP's native mail() function.

public withMail(): static

withSendmail

Send messages using Sendmail.

public withSendmail(): static

withQmail

Send messages using qmail.

public withQmail(): static

save

Save message as eml file.

public save(): bool

Return Value:

True if saved successfully, false otherwise.


send

Create a message and send it.

public send(): bool

Uses the sending method specified by $Mailer.

Return Value:

false on error.

Throws:



Automatically generated on 2025-10-13