我有与XAMPP和WAMP相同的问题。我不确定是什么原因导致此问题,因为日志文件中完全没有。Laravel/XAMPP/Sendmail不发送邮件
我三重检查了我的配置,一切都如它应该我甚至关闭了我的防火墙,但什么也没有发生。
Laravel 4投的这个(超时)异常:Symfony\Component\Debug\Exception\FatalErrorException
\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php165
public function readLine($sequence)
{
if (isset($this->_out) && !feof($this->_out)) {
$line = fgets($this->_out);
if (strlen($line)==0) {
此功能Laravel 4使用读取模板文件。但是访问该文件没有问题,因为它是正确命名的,并且位于正确的文件夹中。这就是发送邮件的方法是这样的一个:
Mail::send('emails.activate', array('url' => $url), function($message) {
$message->to(trim(Input::get('email')))->subject('Account activation.');
});
而Laravel的从config文件夹mail.php:
<?php
return array(
'driver' => 'smtp', // Changed this to mail() and sendmail same error
'host' => 'smtp.gmail.com',
'port' => 465,
'from' => array('address' => '[email protected]', 'name' => 'Support Team'),
'encryption' => 'tls',
'username' => '****@gmail.com',
'password' => '*****',
'sendmail' => 'C:\xampp\sendmail\sendmail.exe -t',
);
在我的php.ini文件我有:
[mail function]
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
SMTP = smtp.gmail.com
smtp_port = 465
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = ****@gmail.com
; XAMPP: Comment out this if you want to work with fakemail for forwarding to your mailbox (sendmail.exe in the sendmail folder)
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
而且在我的sendmail.ini中我有:
smtp_server=smtp.gmail.com
smtp_port=465
smtp_ssl=auto
error_logfile=error.log
auth_username=****@gmail.com
auth_password=****
pop3_server=
pop3_username=
pop3_password=
force_sender=
force_recipient=
hostname=
我ha一切设置正确,我关掉防火墙,检查我的路由器无法跟踪它。