3

I have laravel 5.2 project and i want to connect my laravel with mailcatcher with this setting on my environment file :

MAIL_DRIVER=smtp
MAIL_HOST=myweb.com
MAIL_PORT=1025
MAIL_ENCRYPTION=''
MAIL_USERNAME=''
MAIL_PASSWORD=''
MAIL_FROM_ADDRESS='info@newproject.com'
MAIL_FROM_NAME='New Project Info'

I open this url :

http://myweb.com:1080/

And the MailCatcher show up with empty message, so i start to send mail with this function on my controller :

$mail_content[ 'content' ] = 'Success';
$mail = Mail::send( 'admin.layout.mail', $mail_content, function ( $message ) {
    $message->to( 'me@mail.com', 'Judy' )->subject( 'New Project Info' );
});

After i got this error :

Swift_TransportException in AbstractSmtpTransport.php line 404:
Connection to smooets.com:1025 Timed Out

Am i do wrong set up? Could someone fix it??

1 Answers1

1

We had a similar issue but we are using php-laravel + mailcatcher containers. Try changing the default MAIL_PORT in mail.php to something else and use that env variable in your env file. There is a conflict in the names for MAIL_PORT

mail.php file : port' => env('MAILCATCHER_PORT', 587)

use the new variable:MAILCATCHER_PORT

in your env file

Hope this helps!

Jauyzed
  • 512
  • 4
  • 18