Address in mailbox given [] does not comply with RFC 2822, 3.6.2. when email is in a variable

后端 未结 13 2253
执笔经年
执笔经年 2020-12-16 09:52

I have a correct email address. I have echoed it, but when I send it, I get the following error:

 Address in mailbox given [] does not comply with RFC 2822,          


        
13条回答
  •  别那么骄傲
    2020-12-16 10:17

    I had very similar problem today and solution was as it is..

    $email = Array("Zaffar Saffee" => "myemail@gmail.com");
            $schedule->command('cmd:mycmd')
                     ->everyMinute()
                     ->sendOutputTo("/home/forge/dev.mysite.com/storage/logs/cron.log")
                     ->emailWrittenOutputTo($email);
    

    It laravel 5.2 though...

    my basic problem was , I was passing string instead of array so, error was

    ->emailWrittenOutputTo('mymail@gmail.com'); // string, we need an array
    

提交回复
热议问题