Search code examples
phplaravel-5.5swiftmailer

Address in mailbox given does not comply with RFC 2822, 3.6.2


Sending mail to multiple users.

 $users=a:3:{i:0;s:14:"[email protected]";i:1;s:14:"[email protected]";i:2;N;}
    $usermail=unserialize($users);
    $usermail=json_encode($usermail);
            Mail::to($usermail)
                ->send(new MeetingInvite($meeting,$usermail));

Problem is in to() method when I pass static value to(['[email protected]','[email protected]']) it worked.

Problem is I have data in unserialized format. How to use this.


Solution

  • I found an error in the array. Last value of the array is Null.

    And Removing whitespace solved the problem by using str_replace().