fterenzani / swiftmail
An implementation of the Facade pattern for Swift Mailer 5 and later
Installs: 31
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/fterenzani/swiftmail
Requires
- php: >=5.2.4
- swiftmailer/swiftmailer: >=4.1,5.*
This package is auto-updated.
Last update: 2025-10-29 02:08:55 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.