CodeIgniter Forums
CI Email library with Yandex Mail service - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: CI Email library with Yandex Mail service (/thread-72147.html)



CI Email library with Yandex Mail service - neuron - 11-12-2018

Hi,
I can't get Email library work with Yandex email. I tried several configurations still same result.
Email configurations are: 
PHP Code:
$config = Array(
    
'protocol' => 'smtp',
    
'smtp_crypto' => 'ssl',
    
'smtp_host' => 'smtp.yandex.com',
    
'smtp_port' => 465//tried 25 Port also
    
'smtp_user' => 'username@yandex.com',
    
'smtp_pass' => 'mypassword',
    
'mailtype' => 'html',
    
'charset' => 'utf-8'
    
); 
This is the error I get:
Severity: Warning
Message: fsockopen(): unable to connect to smtp.yandex.com:25 (Connection timed out)
Filename: libraries/Email.php
Line Number: 2069

I tried to test with PHPMailer library, PHPMailer is working good, here is PHPMailer library configs:

PHP Code:
        $this->mailer = new PHPMailer(true); 

        
$this->mailer->Host 'smtp.yandex.com';
        
$this->mailer->Port 465;
        
$this->mailer->SMTPAuth true;
        
$this->mailer->SMTPSecure 'ssl';
        
$this->mailer->SMTPOptions = array (
            
'ssl' => array(
                
'verify_peer' => false,
                
'verify_peer_name' => false,
                
'allow_self_signed' => true)
        );
        
$this->mailer->Username 'username@yandex.com';
        
$this->mailer->Password 'mypassword';
        
$this->mailer->isHTML true



RE: CI Email library with Yandex Mail service - Pertti - 11-12-2018

(11-12-2018, 01:45 AM)neuron Wrote: This is the error I get:
Message: fsockopen(): unable to connect to smtp.yandex.com:25 (Connection timed out)

I'd check your firewall settings, depending on your hosting provider (or local machine) outgoing connections may be closed off by default (or permanently, to avoid anyone using the platform for hacking 3rd party systems).


RE: CI Email library with Yandex Mail service - neuron - 11-12-2018

I am waiting for response from hosting company. 
I asked this question to understand why same settings work in PHPMailer, but in CI Email library it does not work


RE: CI Email library with Yandex Mail service - InsiteFX - 11-12-2018

Did you try this?

PHP Code:
'smtp_crypto' => 'tls'

For phpMailer read this.

Send mail with Yandex SMTP

Only other thing is like mentioned above, your firewall port may be blocked.


RE: CI Email library with Yandex Mail service - neuron - 11-13-2018

I tried several combinations also with TLS, still does not work.

PHPMailer is working, problem is in CI built in Email library. same settings for Email library as PHPMailer.
I mean if there is issue with CI Email library it should be fixed.
For now I will go on with PHPMailer.

I talked with hosting company, they said they did some changes, allow SMTP connection.
Result is I don't get any errors any more, but still I CI Email library is not working