From 17dc5bdc9ede52ad618bbf326e67e3b6988170f7 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 27 Dec 2014 19:10:38 -0500 Subject: Move events handling to Symfony\EventDispatcher --- app/ServiceProvider/MailerProvider.php | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 app/ServiceProvider/MailerProvider.php (limited to 'app/ServiceProvider/MailerProvider.php') diff --git a/app/ServiceProvider/MailerProvider.php b/app/ServiceProvider/MailerProvider.php new file mode 100644 index 00000000..f6b71363 --- /dev/null +++ b/app/ServiceProvider/MailerProvider.php @@ -0,0 +1,36 @@ +getInstance(); + } + + public function getInstance() + { + switch (MAIL_TRANSPORT) { + case 'smtp': + $transport = Swift_SmtpTransport::newInstance(MAIL_SMTP_HOSTNAME, MAIL_SMTP_PORT); + $transport->setUsername(MAIL_SMTP_USERNAME); + $transport->setPassword(MAIL_SMTP_PASSWORD); + $transport->setEncryption(MAIL_SMTP_ENCRYPTION); + break; + case 'sendmail': + $transport = Swift_SendmailTransport::newInstance(MAIL_SENDMAIL_COMMAND); + break; + default: + $transport = Swift_MailTransport::newInstance(); + } + + return $transport; + } +} -- cgit v1.2.3