fterenzani/swiftmail

An implementation of the Facade pattern for Swift Mailer 5 and later

1.1 2013-07-30 16:12 UTC

This package is auto-updated.

Last update: 2024-03-29 02:52:48 UTC


README

SwiftMail is an implementation of the Facade pattern for Swift Mailer 4.x: a powerful component based mailing library for PHP by Chris Corbyn.

A simple e-mail can be sent in this way:

SwiftMail::newInstance($subject, $message)
    ->setTo($to)
    ->setFrom($from)
    ->send()
;

By default SwiftMail try to send emails using the Swift_MailTransport (that use the mail function of PHP). The default transport can be changed using the static method SwiftMail::setDefaultTransport.

$smtp = Swift_SmtpTransport::newInstance($host, $port)
    ->setUsername($user)
    ->setPassword($pass)
;

SwiftMail::setDefaultTransport($smtp);

A list of Tranports is available in the Swift Mailer documentation.