0

I'm trying to send a mail through Postman but it sends a 500 error response.

Here's the code in my controller:

Mail::to($user->email_address)->send(new ClientFinalRegistration($user));

It return an error response in Postman.

"error": "syntax error, unexpected token "=", expecting "]""

What does it mean?


EDIT:

Notice the faqURL key. I forgot to put ">" after the equals sign. That's where the problem occurs.

In my Mail/ClientFinalRegistration.php

/**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->subject($this->subject)
            ->markdown($this->view)
            ->with([
                'user' => $this->user,
                'faqURL' = $this->faqURL,
                'url' => $this->url,
            ]);
    }
6
  • 1
    Show your .env Commented Dec 19, 2022 at 9:25
  • env is not a problem because others are fine Commented Dec 19, 2022 at 9:26
  • Does Postman show the file and line of the error. Commented Dec 19, 2022 at 9:28
  • No it doesn't. But I know that it's that code causing the problem, because whenever I tried to remove it, it successfully continue to the next line Commented Dec 19, 2022 at 9:31
  • What have you tried to resolve the problem? Where are you stuck? The code you've shared does not contain any = character Commented Dec 20, 2022 at 7:09

1 Answer 1

2

The issue here is inside of the ClientFinalRegistration class. Probably when you were adding subject, body, etc.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for pointing it out. There's one missing character in my ClientFinalRegistration class. Arrow is missing. Instead of =>, I wrote there =.
No problem :D Happened too many times hahahah
Yep, I told this to my project manager too and he laughs as well and said "been there been there" lol

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.