Server IP : 127.0.0.2 / Your IP : 3.144.112.72 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/vendor/laravel/framework/src/Illuminate/Mail/ |
Upload File : |
<?php namespace Illuminate\Mail; use Aws\Ses\SesClient; use Illuminate\Support\Arr; use Illuminate\Support\Manager; use GuzzleHttp\Client as HttpClient; use Swift_MailTransport as MailTransport; use Swift_SmtpTransport as SmtpTransport; use Illuminate\Mail\Transport\LogTransport; use Illuminate\Mail\Transport\SesTransport; use Illuminate\Mail\Transport\ArrayTransport; use Illuminate\Mail\Transport\MailgunTransport; use Illuminate\Mail\Transport\MandrillTransport; use Illuminate\Mail\Transport\SparkPostTransport; use Swift_SendmailTransport as SendmailTransport; class TransportManager extends Manager { /** * Create an instance of the SMTP Swift Transport driver. * * @return \Swift_SmtpTransport */ protected function createSmtpDriver() { $config = $this->app['config']['mail']; // The Swift SMTP transport instance will allow us to use any SMTP backend // for delivering mail such as Sendgrid, Amazon SES, or a custom server // a developer has available. We will just pass this configured host. $transport = SmtpTransport::newInstance( $config['host'], $config['port'] ); if (isset($config['encryption'])) { $transport->setEncryption($config['encryption']); } // Once we have the transport we will check for the presence of a username // and password. If we have it we will set the credentials on the Swift // transporter instance so that we'll properly authenticate delivery. if (isset($config['username'])) { $transport->setUsername($config['username']); $transport->setPassword($config['password']); } if (isset($config['stream'])) { $transport->setStreamOptions($config['stream']); } return $transport; } /** * Create an instance of the Sendmail Swift Transport driver. * * @return \Swift_SendmailTransport */ protected function createSendmailDriver() { $command = $this->app['config']['mail']['sendmail']; return SendmailTransport::newInstance($command); } /** * Create an instance of the Amazon SES Swift Transport driver. * * @return \Swift_SendmailTransport */ protected function createSesDriver() { $config = $this->app['config']->get('services.ses', []); $config += [ 'version' => 'latest', 'service' => 'email', ]; if ($config['key'] && $config['secret']) { $config['credentials'] = Arr::only($config, ['key', 'secret']); } return new SesTransport(new SesClient($config)); } /** * Create an instance of the Mail Swift Transport driver. * * @return \Swift_MailTransport */ protected function createMailDriver() { return MailTransport::newInstance(); } /** * Create an instance of the Mailgun Swift Transport driver. * * @return \Illuminate\Mail\Transport\MailgunTransport */ protected function createMailgunDriver() { $config = $this->app['config']->get('services.mailgun', []); return new MailgunTransport( $this->getHttpClient($config), $config['secret'], $config['domain'] ); } /** * Create an instance of the Mandrill Swift Transport driver. * * @return \Illuminate\Mail\Transport\MandrillTransport */ protected function createMandrillDriver() { $config = $this->app['config']->get('services.mandrill', []); return new MandrillTransport( $this->getHttpClient($config), $config['secret'] ); } /** * Create an instance of the SparkPost Swift Transport driver. * * @return \Illuminate\Mail\Transport\SparkPostTransport */ protected function createSparkPostDriver() { $config = $this->app['config']->get('services.sparkpost', []); return new SparkPostTransport( $this->getHttpClient($config), $config['secret'], Arr::get($config, 'options', []) ); } /** * Create an instance of the Log Swift Transport driver. * * @return \Illuminate\Mail\Transport\LogTransport */ protected function createLogDriver() { return new LogTransport($this->app->make('Psr\Log\LoggerInterface')); } /** * Create an instance of the Array Swift Transport Driver. * * @return \Illuminate\Mail\Transport\ArrayTransport */ protected function createArrayDriver() { return new ArrayTransport; } /** * Get a fresh Guzzle HTTP client instance. * * @param array $config * @return \GuzzleHttp\Client */ protected function getHttpClient($config) { $guzzleConfig = Arr::get($config, 'guzzle', []); return new HttpClient(Arr::add($guzzleConfig, 'connect_timeout', 60)); } /** * Get the default mail driver name. * * @return string */ public function getDefaultDriver() { return $this->app['config']['mail.driver']; } /** * Set the default mail driver name. * * @param string $name * @return void */ public function setDefaultDriver($name) { $this->app['config']['mail.driver'] = $name; } }