fterenzani / swiftmail
An implementation of the Facade pattern for Swift Mailer 5 and later
1.1
2013-07-30 16:12 UTC
Requires
- php: >=5.2.4
- swiftmailer/swiftmailer: >=4.1,5.*
This package is auto-updated.
Last update: 2025-03-01 00:42:56 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.