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

aviattor's avatar

Error Sending Mail - Undefined property: stdClass::$email

I have a contact form that i am trying to email when it's submitted. I have done this in several projects without any issues but i am getting this error when i try to send the mail

Undefined property: stdClass::$email

Any help will be greatly appreciated.

0 likes
1 reply
codeparl's avatar

If you used the Mail::to(object) method on the facade, you must provide in the method an object that has email, name properties. Use mail::to(string) with an email address of the recipient. please note that 'mail is lowercase for the second case!

Please or to participate in this conversation.