From 6c76208992bf1bf7fc245b4806f97e6d75e86d3a Mon Sep 17 00:00:00 2001 From: Alexander Pirogov Date: Thu, 18 Jul 2013 14:14:22 +0300 Subject: [PATCH] added smtp_encryption config parameter --- PHPCI/Command/InstallCommand.php | 1 + PHPCI/Plugin/Email.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/PHPCI/Command/InstallCommand.php b/PHPCI/Command/InstallCommand.php index ad9cbeb7..dea4e560 100644 --- a/PHPCI/Command/InstallCommand.php +++ b/PHPCI/Command/InstallCommand.php @@ -50,6 +50,7 @@ class InstallCommand extends Command $conf['phpci']['email_settings']['smtp_address'] = $this->ask('(Optional) Smtp server address: ', true); $conf['phpci']['email_settings']['smtp_port'] = $this->ask('(Optional) Smtp port: ', true); + $conf['phpci']['email_settings']['smtp_encryption'] = $this->ask('(Optional) Smtp encryption: ', true); $conf['phpci']['email_settings']['smtp_username'] = $this->ask('(Optional) Smtp Username: ', true); $conf['phpci']['email_settings']['smtp_password'] = $this->ask('(Optional) Smtp Password: ', true); $conf['phpci']['email_settings']['from_address'] = $this->ask('(Optional) Email address to send from: ', true); diff --git a/PHPCI/Plugin/Email.php b/PHPCI/Plugin/Email.php index ae7ced05..798a01b5 100644 --- a/PHPCI/Plugin/Email.php +++ b/PHPCI/Plugin/Email.php @@ -140,7 +140,8 @@ class Email implements \PHPCI\Plugin /** @var \Swift_SmtpTransport $transport */ $transport = \Swift_SmtpTransport::newInstance( $this->getMailConfig('smtp_address'), - $this->getMailConfig('smtp_port') + $this->getMailConfig('smtp_port'), + $this->getMailConfig('smtp_encryption') ); $transport->setUsername($this->getMailConfig('smtp_username')); $transport->setPassword($this->getMailConfig('smtp_password')); @@ -164,6 +165,8 @@ class Email implements \PHPCI\Plugin return null; case 'smtp_port': return '25'; + case 'smtp_encryption': + return null; case 'from_address': return "notifications-ci@phptesting.org"; default: