diff --git a/app/Providers/ZendFrameworkServiceProvider.php b/app/Providers/ZendFrameworkServiceProvider.php index 85a6d21ef..3ad41d07a 100644 --- a/app/Providers/ZendFrameworkServiceProvider.php +++ b/app/Providers/ZendFrameworkServiceProvider.php @@ -379,7 +379,15 @@ private function setupLogger( array $options ): array { * Setup mailer */ private function setupMailer( array $options ): array { - $options['ondemand_resources']['mailer']['smtphost'] = config('mail.host'); + + $options['resources']['mailer']['smtphost'] = config('mail.host'); + + $options['resources']['mailer']['port'] = config('mail.port',null) ?? 25; + + $options['resources']['mailer']['auth'] = config('mail.auth',null); + $options['resources']['mailer']['username'] = config('mail.username',null); + $options['resources']['mailer']['password'] = config('mail.password',null); + return $options; } diff --git a/library/OSS/Resource/Mailer.php b/library/OSS/Resource/Mailer.php index 9f514bf15..9092c6169 100644 --- a/library/OSS/Resource/Mailer.php +++ b/library/OSS/Resource/Mailer.php @@ -77,7 +77,7 @@ public function getMailer() if( count( $options ) ) { - if( isset( $options['auth'] ) ) + if( isset( $options['auth'] ) && $options['auth'] ) { $config = array( 'auth' => $options['auth'], @@ -88,6 +88,10 @@ public function getMailer() else $config = array(); + if( isset( $options['port'] ) ) { + $config['port'] = $options['port']; + } + $transport = new Zend_Mail_Transport_Smtp( $options['smtphost'], $config ); Zend_Mail::setDefaultTransport( $transport );