Laravel Mail::send()实际上不适用于from


Laravel Mail::send() do not really work with from

也许有人能看出我做错了什么。当我使用->from('test@example.com')时,邮件发送得很好。但是当我使用>from('test@hotmail.com')时,邮件不会被发送。一切都是在邮件配置中完成的。

        $data = array("content" => Input::get("content"));
        Mail::send("emails.text", $data, function($message)
        {
            $message->to('toMe@myDomain.com')
            ->from('test@hotmail.com' , 'Contact form message!');
        });

配置:

'driver' => 'smtp',
'host' => 'mail.cornex.se',
'port' => 587,
'from' => array('address' => "christopher@cornex.se", 'name' => "Kristoffer"),
'encryption' => 'tls',

Hotmail使用Outlook SMTP。请尝试以下操作:
您可能需要稍作修改,但要特别注意host

'driver' => 'smtp',
'host' => 'smtp-mail.outlook.com',
'from' => array('address' => "christopher@cornex.se", 'name' => "Kristoffer")
'port' => 587, // or 25
'encryption' => 'tls',
相关文章: