alejin1978's avatar

queue works in postman but not in browser

I have an api that sends emails using a job, I test it in postman and it works perfectly but when I call it from a button it does not execute the job. any suggestion? Thanks

I try to debug it using logs, when use postman it works like a charm but when use it in a button it has an error: Expected response code "250" but got code "530", with message "530 5.7.1 Authentication required". then the job does not execute

0 likes
2 replies
Snapey's avatar

Code?

We can't dream what you have written or how you might create a job with a button.

Your error appears to be an SMTP error so unlikely to be that it does not run the job

alejin1978's avatar

@Snapey Hi, thanks for you reply

public function test()
{
    $data['pass'] = 'FnJKfkuG';
    $data['name'] = 'Gordon';
    $data['route'] = 'myapi.test/validate-email/jQZSPFSZLuBqAdQofxtV5Bw2TK4ZcrNmoxFFR5ZvgGM48gHyKcxv7y6jHBaZhHIF';
    $data['email'] = '[email protected]';
    $data['title'] = 'Hi!!';
    $data['body'] = 'Text here.';
    $x= SendEmailJob::dispatch('', $data,'','', $data['email'],'welcome');
    return sendResponse($x, 'Ok');
}

it works in postman with the route: myapi.test/api/v1/test, the job y executed and email is sent

but when I call this route from another project, it does not work

I use this code to send email

function sendMail($mailTo, $subject, $view, $data, $from) { try { Mail::to($mailTo)->send(new SendMail($from, $data, $view, $subject)); return sendResponse('Ok'); } catch (\Exception $e) { Log::debug($e->getMessage()); return sendExceptionError('Error 2',$e->getMessage()); } }

I use Log to know the error... when i use postman there is no error but when I call it from another project the log shows this error: expected response code 250 but got code 530 with message 530 5.7.1 authentication required

it is so weird, I dont understand why

Help me please, sorry for my bad english

Please or to participate in this conversation.