Support the ongoing development of Laravel.io →
posted 10 years ago
Mail
Last updated 2 years ago.
0

Try port 597

Last updated 2 years ago.
0

I was having problem too. I solved it by setting the encryption setting to tls.

0

With Google I didn't have any problem using this port: 'port' => 587,

0

According to arclab google's smpt setup:

smtp.gmail.com	  ---    SSL	   ---      465
smtp.gmail.com	  ---   StartTLS ---   587

Then double check if your login credentials are correct.

Also i found out that sometimes google/gmail blocks your account from sending mails if you're trying to send from a different location so your account needs to authorize this.

0

replace _establishSocketConnection with the modification func

private function _establishSocketConnection() { $host = $this->_params['host']; if (!empty($this->_params['protocol'])) { $host = $this->_params['protocol'].'://'.$host; } $timeout = 15; if (!empty($this->_params['timeout'])) { $timeout = $this->_params['timeout']; } $options = array();

    $options['ssl']['verify_peer'] = FALSE; 
    $options['ssl']['verify_peer_name'] = FALSE;


    if (!empty($this->_params['sourceIp'])) {
        $options['socket']['bindto'] = $this->_params['sourceIp'].':0';
    }
    if (isset($this->_params['stream_context_options'])) {
        $options = array_merge($options, $this->_params['stream_context_options']);
    }
    $streamContext = stream_context_create($options);
    $this->_stream = @stream_socket_client($host.':'.$this->_params['port'], $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $streamContext);
    if (false === $this->_stream) {
        throw new Swift_TransportException(
            'Connection could not be established with host '.$this->_params['host'].
            ' ['.$errstr.' #'.$errno.']'
            );
    }
    if (!empty($this->_params['blocking'])) {
        stream_set_blocking($this->_stream, 1);
    } else {
        stream_set_blocking($this->_stream, 0);
    }
    stream_set_timeout($this->_stream, $timeout);
    $this->_in = &$this->_stream;
    $this->_out = &$this->_stream;
}
0

Sign in to participate in this thread!

Eventy

Your banner here too?

jacko1998 jacko1998 Joined 2 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.