class \mpf\helpers\MailHelper

class \mpf\helpers\MailHelper

-no description found-

Attributes
public callable $method

It can be replaced from config to use another mailing engine. Here must be defined the function to be called in that case. It can also be "swift" and it will use SwiftMailer

public array $from = {"default":{"email":"me@domain.com","name":"MPF App","reply-to":{"email":"me@domain.com","name":"MPF App"},"smtpHost":"127.0.0.1","smtpPort":"25","smtpUser":"","smtpPassword":"","smtpSecure":false}}

List of addresses to be used when sending an email. Multiple addresses can be defined Examples: 'default', 'errors', 'contact', 'orders' and so on

protected \Swift_Mailer[] $swiftMailers

-no description found-

Methods

protected \Swift_Mailer __getSwiftMailer (mixed $from)

  • $from

    -no description found-

-no description found-

protected mixed _swiftMail (mixed $to, mixed $from, mixed $subject, mixed $message, mixed $attachments = [], mixed $html = true)

  • $to

    -no description found-

  • $from

    -no description found-

  • $subject

    -no description found-

  • $message

    -no description found-

  • $attachments

    -no description found-

  • $html

    -no description found-

-no description found-

protected bool _mail (string $to, string $from, string $subject, string $message, array $attachments = [], array $headerExtra = [], bool $html = true)

  • $to

    Simple email or an array('email' => .., 'name' => ..) or a list of recipients

  • $from

    Same as $to plus option to define reply-to address. It will usually be filled from $this->from value.

  • $subject

    Email subject. A simple string that will be sent as it is

  • $message

    Email content.

  • $attachments

    List of paths to attachments and name of the attachment as key

  • $headerExtra

    Extra header options. Optional.

  • $html

    -no description found-

Any other method used to send email must accept this parameters.

public bool send (mixed $to, mixed $subject, mixed $message, string $from = "default", array $headerExtra = [], bool $html = true)

  • $to

    -no description found-

  • $subject

    -no description found-

  • $message

    -no description found-

  • $from

    -no description found-

  • $headerExtra

    -no description found-

  • $html

    -no description found-

Send simple message with no attachments

public bool sendAttachments (mixed $to, mixed $subject, mixed $message, mixed $attachments, string $from = "default", array $headerExtra = [], bool $html = true)

  • $to

    -no description found-

  • $subject

    -no description found-

  • $message

    -no description found-

  • $attachments

    -no description found-

  • $from

    -no description found-

  • $headerExtra

    -no description found-

  • $html

    -no description found-

Send message with attachments