• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI Email library with Yandex Mail service

#1
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
Reply

#2
(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).
Reply

#3
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
Reply

#4
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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#5
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
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.