I'm sending an email using Laravel:
$userAndEmail = '"' . $user->name() . '" <' . $user->email . '>';
Mail::to($userAndEmail)->send(new UserCreated($user, $userUnencryptedPassword));
This is returning the following error message:
Address in mailbox given ["Bob asdf" <rava@gmail.com>] does not comply with RFC 2822, 3.6.2.
This works if $userAndEmail
is just an email address, such as rava@gmail.com
. Any tips on what might be wrong?
Thanks