Swift_TransportException with Mailtrap

Published 2 months ago by adamkeen

I'm running Laravel 5.5 and when i try to send email i got Swift_TransportException Expected response code 250 but got code "", with message "".

I'm on localhost and i use Mailtrap to catch outgoing emails it was working perfect with the same settings but after a while i got that exception.

what weird is when i change my IP address using a vpn it works and when i disable it it won't

i contacted their support and asked if my IP is banned and they say no

So anyone can help me out i'm really confused Thank you in advance.

mindz

Maybe you have issue with internet connection when not on vpn?

adamkeen

No, no issues , i used vpn just because i thought i got banned but they say you're not

mindz

And you are sure that all config strings in .env are correct and not cached??

adamkeen

yes i checked that too, i read some similar problems here in the forum i tried them all but no result

mindz

provide mail.php config file from config/mail.php

adamkeen

i didn't touch this file yet

    'driver' => env('MAIL_DRIVER', 'smtp'),
    'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
    'port' => env('MAIL_PORT', 587),
    'from' => [
        'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
        'name' => env('MAIL_FROM_NAME', 'Example'),
    ],
    'encryption' => env('MAIL_ENCRYPTION', 'tls'),
    'username' => env('MAIL_USERNAME'),
    'password' => env('MAIL_PASSWORD'),
    'sendmail' => '/usr/sbin/sendmail -bs',
    'markdown' => [
        'theme' => 'default',

        'paths' => [
            resource_path('views/vendor/mail'),
        ],
    ],

my .env configuration

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=07c03104a315b8
MAIL_PASSWORD=f51aac486a6f72
MAIL_ENCRYPTION=null
mindz

What OS you're using? You are aware you should have smpt server set up? Have you got it?

adamkeen

I'm using windows 10 / wampserver as a localhost, the smtp is set up otherwise i can't send emails when using vpn

mindz

What smtp you using?

mindz
Dibya
Dibya
1 month ago (2,010 XP)

Change port no 25 or 465 or 2525 and you good to go

Please sign in or create an account to participate in this conversation.