问题描述:

I have the same problem with XAMPP and WAMP. I'm unsure what causes this problem as there is absolutely nothing in log files.

I triple checked my configuration and everything is as it should be I even turned off my firewall and yet nothing happens.

Laravel 4 throw's this (timeout) exception: 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) {

This function Laravel 4 uses to read the template file. However no problem accessing the file either as it is properly named and in proper folder. The method that send's the mail is this one:

 Mail::send('emails.activate', array('url' => $url), function($message) {

$message->to(trim(Input::get('email')))->subject('Account activation.');

});

And Laravel's mail.php from config folder:

<?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',

);

In my php.ini file I have:

[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"

And in my sendmail.ini I have:

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=

I have everything set properly, i turned off firewall, checked my router cant trace it anyhow.

网友答案:

I posted an answer here that may solve this for some.

In short, when using port 465, the default encryption setting needs to be changed from tls to ssl.

'host' => 'smtp.gmail.com',
'port' => 465, 
'encryption' => 'ssl',
网友答案:

You probably figured it out by now, but I think the problem is with your

    Mail::send('emails.activate', array('url' => $url), function($message) {
    $message->to(trim(Input::get('email')))->subject('Account activation.');
});

Try changing it to:

    $to = trim(Input::get('email'));
    $subject = 'Account activation.'; //for illustration purposes
    Mail::send('emails.activate', array('url' => $url), function($message) use ($to, $subject){
    $message->to($to)->subject($subject);
});
网友答案:

If gmail is blocking you and won't let you signin with your credentials try this.

Login with your gmail account and than go to: https://accounts.google.com/b/0/DisplayUnlockCaptcha

and click continue and than you have few minutes to send your mail with your code. After this google will allow signin to that account from the new source.

相关阅读:
Top