我正在使用下面的代码通过Laravel 4发送电子邮件。
Mail::send('emails.welcome', array('data' => 'This is a test content' ), function($message)
{
$message->to('mymail@site.com', 'TomTom')->subject('Welcome to Laravel!');
});
每当我尝试发送电子邮件时,都会抛出以下错误:
A connection could not be established with the host
smtpout.asia.secureserver.net [Connection refused #111]
但是当我使用的php mail函数发送电子邮件时,它工作得很好!
var_dump(mail("mymail@site.com", "subject", "hello world"));
那么问题出在哪里呢?
发布于 2015-11-24 04:44:22
您可以尝试其他端口:
return array(
'driver' => 'smtp',
'host' => 'ailstore1.asia.secureserver.net',
'port' => 465,
'from' => array('address' => 'mail@mysite.in', 'name' => 'name'),
'encryption' => 'ssl',
'username' => '',
'password' => '',
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false
);
https://stackoverflow.com/questions/31595944
复制相似问题