David
David

Reputation: 39

Laravel ElasticEmail Config

I'm struggling with configuring Laravel email. This is my first Laravel project, I am WordPress Web Developer.

And this is the error code I'm getting.

Expected response code 250 but got code "", with message ""

What am I doing wrong?

This is .env file

MAIL_DRIVER=smtp
MAIL_HOST=smtp.elasticemail.com
MAIL_PORT=2525
[email protected]
MAIL_PASSWORD=password
MAIL_ENCRYPTION=TLS

This is mail.php in config folder

    'driver' => env('MAIL_DRIVER', 'smtp'),
    'host' => env('MAIL_HOST', 'smtp.elasticemail.com'),
    'port' => env('MAIL_PORT', 2525),
    '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'),
        ],
    ],

I've tried almost every possible combination of ports, ssl, tls and can't figure out why email doesn't work. Email should be sent to new user registration, and I get this error, while user gets saved to database.

Upvotes: 0

Views: 2652

Answers (3)

David
David

Reputation: 39

I have actuallly got wrong credentials from support, and sonce we're using Cloudways and have subscribed to Elastic Email through them, I had to use API key as username and password. Then everything worked like a charm.

Upvotes: 1

You might want to use API instead of SMTP, as it is a better way to do that in the long term.

We constantly work on adding new plugins to most popular tools so a ready made solution will show up. I can't give you an exact date just yet.

Upvotes: 0

Stijn Bakker
Stijn Bakker

Reputation: 36

I think you would need some more code to achieve this with ElasticMail.

Take a look at this wrapper, it allows you to easily use your ElasticSearch account.

Upvotes: 0

Related Questions