0

en localhost con Laravel puedo mandar correos, pero cuando lo he subido al hosting me da un error.

Hace unos días tuve un problema con Mysql al subir al hosting y era tocar un archivo.Pero no sé que tengo que hacer en este caso :

 1/1 Swift_TransportException in AbstractSmtpTransport.php line 383: Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8 https://support.google.com/mail/?p=BadCredentials n64sm7928124ywn.21 - gsmtp
"

    in AbstractSmtpTransport.php line 383
    at Swift_Transport_AbstractSmtpTransport->_assertResponseCode('535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials n64sm7928124ywn.21 - gsmtp ', array('250')) in AbstractSmtpTransport.php line 281
    at Swift_Transport_AbstractSmtpTransport->executeCommand('RSET ', array('250'), array()) in EsmtpTransport.php line 270
    at Swift_Transport_EsmtpTransport->executeCommand('RSET ', array('250')) in XOAuth2Authenticator.php line 55
    at Swift_Transport_Esmtp_Auth_XOAuth2Authenticator->authenticate(object(Swift_SmtpTransport), '[email protected]', 'passemail') in AuthHandler.php line 176
    at Swift_Transport_Esmtp_AuthHandler->afterEhlo(object(Swift_SmtpTransport)) in EsmtpTransport.php line 332
    at Swift_Transport_EsmtpTransport->_doHeloCommand() in AbstractSmtpTransport.php line 118
    at Swift_Transport_AbstractSmtpTransport->start() in Mailer.php line 79
    at Swift_Mailer->send(object(Swift_Message), array()) in Mailer.php line 394
    at Mailer->sendSwiftMessage(object(Swift_Message)) in Mailer.php line 179
    at Mailer->send('mensaje', array('cadena' => 'cE4cUKekrS'), object(Closure)) in Facade.php line 219
    at Facade::__callStatic('send', array('mensaje', array('cadena' => 'cE4cUKekrS'), object(Closure))) in administrador.php line 315
    at Mail::send('mensaje', array('cadena' => 'cE4cUKekrS'), object(Closure)) in administrador.php line 315
    at administrador->nuevaContra(object(Request))
    at call_user_func_array(array(object(administrador), 'nuevaContra'), array(object(Request))) in Controller.php line 256
    at Controller->callAction('nuevaContra', array(object(Request))) in ControllerDispatcher.php line 164
    at ControllerDispatcher->call(object(administrador), object(Route), 'nuevaContra') in ControllerDispatcher.php line 112
    at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
    at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 114
    at ControllerDispatcher->callWithinStack(object(administrador), object(Route), object(Request), 'nuevaContra') in ControllerDispatcher.php line 69
    at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\administrador', 'nuevaContra') in Route.php line 203
    at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
    at Route->run(object(Request)) in Router.php line 708
    at Router->Illuminate\Routing\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
    at Pipeline->then(object(Closure)) in Router.php line 710
    at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 675
    at Router->dispatchToRoute(object(Request)) in Router.php line 635
    at Router->dispatch(object(Request)) in Kernel.php line 236
    at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 50
    at VerifyCsrfToken->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
    at ShareErrorsFromSession->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
    at StartSession->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
    at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
    at EncryptCookies->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 44
    at CheckForMaintenanceMode->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
    at Pipeline->then(object(Closure)) in Kernel.php line 122
    at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
    at Kernel->handle(object(Request)) in index.php line 54
3
  • Ya permitiste a tu correo poder enviar correo por IMAP? Commented el 8 mar. 2018 a las 13:30
  • podrías también poner como lo configuraste en tu .env Commented el 8 mar. 2018 a las 13:32
  • En localhost funciona bien, ha sido por subirlo al hosting.
    – EduBw
    Commented el 9 mar. 2018 a las 14:07

1 respuesta 1

1

Tenes que entrar a estos dos links y activarlos, logueado con la cuenta de Gmail que estas usando para enviar mails en tu app:

https://myaccount.google.com/lesssecureapps https://accounts.google.com/b/0/DisplayUnlockCaptcha

Por otro lado en tu .env usa los siguientes host, port y encryption:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_ENCRYPTION=tls

Espero que te sirva, saludos!

1
  • Perfecto era lo de activar menos seguras y permitir a google. Gracias crack =)
    – EduBw
    Commented el 10 mar. 2018 a las 22:03

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.