Support the ongoing development of Laravel.io →
posted 10 years ago
Mail

hi all I am doing a simple mail::send and get this error: Message could not be delivered. Please ensure the message is RFC 5322 compliant

here is the simple code:

        $data = array(
	        'theMessage'=>$messageField
        );
        $theName = $theContact->first_name.' '.$theContact->last_name;

        \Mail::send('emails.message', $data, function($message) use ($theUser, $theName, $toField, $subjectField)
        {   
            $message->sender($theUser->email);
            $message->to($toField,$theName);
            $message->subject($subjectField);
        });

here is the blade template

<!DOCTYPE html>
<html lang="en-US">
	<head>
		<meta charset="utf-8">
	</head>
	<body>
		<div>{{$theMessage}}</div>
	</body>
</html>

Last updated 2 years ago.
0

Hi tamirh67,

What do you have on the config file for the mail app/conf/mail.php or app/conf/ENV/mail.php? Do you use the smtp, mail or sendmail driver?

If you work in local and you don't use an smtp you have to pretend the mail or use a software to check the mails like https://papercut.codeplex.com/

Last updated 10 years ago.
0

i tried smtp, mail, and autogun drivers, ssl/tls protocols and relevant channels

the mail is sent, but for some reason it is in the wrong format

0

May you put an example of the format you receive please?

0

i just get a message back from the inbox that i am sending from with this message:

Message could not be delivered. Please ensure the message is RFC 5322 compliant

0

Sign in to participate in this thread!

Eventy

Your banner here too?

tamirh67 tamirh67 Joined 24 Nov 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.