mailjet / laravel-mailjet

Laravel package for Mailjet API V3 and Laravel Mailjet Mail Transport
MIT License
94 stars 93 forks source link

User is not set. #65

Closed pit07 closed 1 year ago

pit07 commented 2 years ago

Hi! I followed the guidelines, but i have this issue:

User is not set

image

In my .env file, i have only this variable:

MAIL_MAILER=mailjet
MAILJET_APIKEY= [my api key]
MAILJET_APISECRET= [my api secret key]
MAIL_FROM_ADDRESS=bonjour@nougats-silvain.fr
MAIL_FROM_NAME=NOUGATSSILVAIN

In my mail.php file:

'mailjet' => [
            'transport' => 'mailjet',
            'key' => env('MAILJET_APIKEY'),
            'secret' => env('MAILJET_APISECRET'),
            'transactional' => [
                'call' => true,
                'options' => [
                    'url' => 'api.mailjet.com',
                    'version' => 'v3.1',
                    'call' => true,
                    'secured' => true
                ]
            ],
        ],

In services.php :

'mailjet' => [
        'key' => env('MAILJET_APIKEY'),
        'secret' => env('MAILJET_APISECRET'),
    ]

And my route:

Route::get('/email', function() {

    $messageBody = "TEST MESSAGE BODY";
    Mail::raw($messageBody, function($message) {
        $message->to('vincent.blondaux@gmail.com', 'TEST')
            ->subject('TEST');
        $message->from('vincent.blondaux@gmail.com','My name');
    });
});

What i'm doing wrong? Thanks a lot! Vincent

oleksandr-mykhailenko commented 1 year ago

Hello @pit07 So after debug your examples of code I see that everything works for me. Probably, you have some miss configuration on your local env. Please check that everything was installed correctly