Sending email with Laravel 4.2 does not reach recipients

0

Hello,

I'm trying to send emails using Laravel 4.2 but the messages only arrive when the recipient's email is the same as the one they are sending. The configuration of the mail.php file looks like this:

<?php

return array(


    'driver' => 'smtp',
    'host' => 'smtp.gmail.com',
    'port' => 587,
    'from' => array('address' => '[email protected]', 'name' => 'Teste com Emails'),
    'encryption' => 'tls',
    'username' => '[email protected]',
    'password' => '1234567890',
    'sendmail' => '/usr/sbin/sendmail -bs',
    'pretend' => false,

);

The code used to send emails looks like this:

\Mail::send('emails.hello', array('key' => 'value'), function($message)
            {
                $message->to('[email protected]', 'Leandro');
                $message->from('[email protected]', 'Testes');
                $message->subject('Welcome!');
            });

One detail that may be important, I'm working on a localhost development environment for the application.

Thank you in advance for your attention.

    
asked by anonymous 12.12.2016 / 13:44

0 answers