你好我们正试图在laravel发送一封电子邮件,事情是它给我这个错误。有人可以解释为什么我面临这个错误。这是我的代码:
Route::get('testmail', function () {
/* \Mail::send('emails.test', array(), function ($m) {
$m->from('contrivesol@gmail.com', 's2c Mobile');
$m->subject('Review Request For ');
$m->to("gardezisyedmuhammadali@gmail.com", "Gardezi");
});
*/
$user='';
\Mail::send('emails.test', ['user' => null], function ($m) use ($user) {
$m->from('contrivesol@gmail.com', 'Your Application');
$m->to('ovaiz.mushtaq@gmail.com', 'Awais')->subject('Your Reminder!');
});
});
以下是我的错误日志
的屏幕截图[2016-09-07 13:50:18] production.ERROR: exception 'Swift_TransportException' with message 'Expected response code 220 but got code "500", with message "500 Unknown command
"' in /var/www/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:383
Stack trace:
#0 /var/www/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(281): Swift_Transport_AbstractSmtpTransport->_assertResponseCode('500 Unknown com...', Array)
#1 /var/www/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php(270): Swift_Transport_AbstractSmtpTransport->executeCommand('STARTTLS\r\n', Array, Array)
#2 /var/www/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php(313): Swift_Transport_EsmtpTransport->executeCommand('STARTTLS\r\n', Array)
#3 /var/www/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(118): Swift_Transport_EsmtpTransport->_doHeloCommand()
#4 /var/www/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(79): Swift_Transport_AbstractSmtpTransport->start()
#5 /var/www/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(366): Swift_Mailer->send(Object(Swift_Message), Array)
#6 /var/www/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(168): Illuminate\Mail\Mailer->sendSwiftMessage(Object(Swift_Message))
#7 /var/www/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(216): Illuminate\Mail\Mailer->send('emails.test', Array, Object(Closure))
#8 /var/www/app/Http/routes.php(34): Illuminate\Support\Facades\Facade::__callStatic('send', Array)
#9 /var/www/app/Http/routes.php(34): Illuminate\Support\Facades\Mail::send('emails.test', Array, Object(Closure))
#10 [internal function]: RRS\Providers\RouteServiceProvider->{closure}()
#11 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Route.php(157): call_user_func_array(Object(Closure), Array)
#12 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Route.php(129): Illuminate\Routing\Route->runCallable(Object(Illuminate\Http\Request))
#13 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(701): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#14 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#15 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#16 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#17 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(101): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#18 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(703): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#19 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(670): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#20 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(628): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#21 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(214): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#22 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#23 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#24 /var/www/vendor/fideloper/proxy/src/TrustProxies.php(46): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#25 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(125): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#26 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(43): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#27 /var/www/app/Http/Middleware/VerifyCsrfToken.php(17): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#28 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(125): RRS\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#29 /var/www/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(55): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#30 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(125): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#31 /var/www/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(61): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#32 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(125): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#33 /var/www/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(36): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#34 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(125): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#35 /var/www/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(40): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#36 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(125): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#37 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(42): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#38 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(125): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#39 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#40 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(101): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#41 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(115): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#42 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(84): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#43 /var/www/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#44 {main}