Laravel Mail适用于一个但不适用于其他

For this website I have a contact form, which simply sends a mail like this:

Mail::send('emails.contact', $input, function ($m) {
    $m->from(Input::get('email'), Input::get('name'));
    $m->to('secretaris@****.nl', 'Secretaris ****')->subject('Contactform: '. Input::get('name'));
});

The $input variable is simply:

$input = Input::all();

Then the view looks like this:

<html>
<body>

<b>{{$name}} ({{$mail}}) sent u a message via the contactform on ****.nl</b>
<br>
<div>
{{$message}}
</div>
<br>

</body>
</html>

This mail does send. But this one somehow doesn't:

Mail::send('emails.registermember', $data, function ($m) {
    $m->from('no-reply@****.nl', 'No-Reply ****');
    $m->to('secretaris@****.nl', 'Secretaris ****')->subject('Registration of ' . ucfirst(Input::get('firstname')) . ' as Register-member');
});

The $data value here is:

$data = [
    'naam' => ucfirst($user->voornaam) . ' ' . ucfirst($user->achternaam),
    'id' => $user->id,
];

With the view:

<html>
<body>
<p>
    <b>{{$name}}</b> registered as register member at website of ****.
</p>

</body>
</html>

This mail does not send and doing Mail::failures() returns:

[
"secretaris@****.nl",
]

I don't see what's the difference between those mail functions, and why one works and the other doesn't.

For privacy reasons I marked the website name with ****

I hope someone can help me out!

Thanks

  • I suspect the error is in this line

$m->from('no-reply@****.nl', 'No-Reply ****');

  • Please check if you can sent out an email via this email through Laravel

no-reply@****.nl

  • Check to see if you configure it properly in .env file