Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

HUGE_DICK_10_INCHES's avatar

No hint path defined for [mail]. Laravel 7

I am trying to view mail markdown within the browser and it returns error "No hint path defined for [mail].".

php artisan make:mail Test --markdown=emails.test

Build method from mail class

public function build()
{
    return $this->markdown('emails.test');
}

I have just this in my web routes:

Route::get('/test-email', function () {
    return new \App\Mail\Test();
});

How can I solve this?

0 likes
7 replies
Sinnbeck's avatar

Does the file views/emails/test.blade.php exist?

HUGE_DICK_10_INCHES's avatar

Of course, it does. Seems like, when I remove components from file and add custom HTML it works...

jayedhasan232's avatar

Please check your "Mailable" class. A typo mistake causes this problem.

Please see below code. If you have generated a "normal" mailable, then please check if you placed "->markdown()" instead of "->view()".

public function build()
    {
        return $this->from(env('MAIL_FROM_ADDRESS'), env('MAIL_FROM_NAME'))
                    ->subject($this->subject)
                    ->view('emails.reminder.trial');
    }
1 like
automica's avatar

@jayedhasan232 i'm getting the same issue.

if i use:

    public function build()
    {
        return $this
            ->markdown('emails.verifyAccount')
            ->with('mailData', $this->mailData);
    }

then my mail sends. As i have html in my templates and don't want to encode that, then i'm doing

    public function build()
    {
        return $this
            ->view('emails.verifyAccount')
            ->with('mailData', $this->mailData);
    }

which fails with @skycoder original No hint path defined for [mail]. error.

my blade looks like:

@component('mail::message')
    {{ $mailData['title'] }}

    Click link below to verify your account

    @component('mail::button', ['url' => $mailData['url']])
        Verify your account
    @endcomponent
@endcomponent

so issue seems that view is unable to understand `'mail::message'

Which is a bit weird..

@skycoder did you get yours to work using standard ->view() ?

automica's avatar

for anyone following along, my issue related to html elements in the prebuilt Markdown mailable templates being escaped when rendered in the template.

https://laravel.com/docs/7.x/mail#markdown-mailables

So the issue was caused by reformatting the email template in my IDE, which introduced indentation and that was then fooling the Markdown class into thinking was i using a code block

So if you come across this issue you be wise to follow the inline comment in the documentation:

Do not use excess indentation when writing Markdown emails. Markdown parsers will render indented content as code blocks.
sunilbfcj's avatar

Simply delete the mail or notification folder from the vendor folder and re-export the component using publish command

php artisan vendor:publish --tag=laravel-mail

If you don't want to remove it, please check the components you modified and fix your mistakes.

vicodeveloper's avatar

Try to add in config/mail.php

    'markdown' => [
        'theme' => 'default',
        'paths' => [
            resource_path('views/vendor/mail'),
            resource_path('views/emails'), 
        ],
    ],

Please or to participate in this conversation.