CodeIgniter Forums
Mail Class Error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Mail Class Error (/showthread.php?tid=76710)



Mail Class Error - 68thorby68 - 06-11-2020

Hi,

I'm having problems send mail using the mail class.
My mail host has tailed the incomimg message and noted the following:

"I think the issue is that you are using a Cypher which is no longer supported server side. For example on our side we are usingĀ IO::Socket::SSL perl library.

I am not sure about the software you have built but my guess is the library it is using is out of date to the current version we are using."


What cypher is codeigniter 4 mail class using?

The mail host log:


RE: Mail Class Error - jreklund - 06-11-2020

What settings are you using? There are three types of mail "clients"; mail, sendmail and smtp.


RE: Mail Class Error - 68thorby68 - 06-11-2020

(06-11-2020, 01:40 PM)jreklund Wrote: What settings are you using? There are three types of mail "clients"; mail, sendmail and smtp.
I'm using smtp

the full config is:

$email = \Config\Services::email();

$config['protocol'] = 'smtp';
$config['mailPath'] = '/usr/sbin/sendmail';
$config['SMTPHost'] = 'cherry.ukhost4u.com';
$config['SMTPUser'] = '[email protected]';
$config['SMTPPass'] = 'xxxxxxxxxxxxx';
$config['SMTPPort'] = '465';
$config['SMTPCrypto'] = 'ssl'; (or tls either should work)

$config['mailType'] = 'html'; (or text, either should work)

$email->initialize($config);

$email->setFrom('[email protected]'); //('[email protected]', 'Your Name')
$email->setTo('[email protected]'); //('[email protected]')

$email->setSubject('test'); //('Email Test')
$email->setMessage('try this for size'); //('Testing the email class.')


$email->send(false);

print_r($email->printDebugger(['body']));


RE: Mail Class Error - InsiteFX - 06-12-2020

Are you sure the port number is 465?

Some SMTP server also use port 587.


RE: Mail Class Error - 68thorby68 - 06-12-2020

Absolutely sure.

The server maintains two types of connection, SSL and non-SSL.

port 465 for SSL, port 587 for non-SSL.

I have been using this company for over 10 years and for this issue I have spent a lot of time online with their support desk who have been running live traces as I've been executing the code.


RE: Mail Class Error - jreklund - 06-12-2020

To my knowledge, you can't specify any cypher with ssl. It's based on the systems OpenSSL version.
Here are the copy of the code connecting to the server.

Does the debug specify something more specific, on where it fails?

PHP Code:
    protected function SMTPConnect()
    {
        if (
is_resource($this->SMTPConnect))
        {
            return 
true;
        }
        
$ssl               = ($this->SMTPCrypto === 'ssl') ? 'ssl://' '';
        
$this->SMTPConnect fsockopen(
                
$ssl $this->SMTPHost$this->SMTPPort$errno$errstr$this->SMTPTimeout
        
);
        if (! 
is_resource($this->SMTPConnect))
        {
            
$this->setErrorMessage(lang('Email.SMTPError', [$errno ' ' $errstr]));
            return 
false;
        }
        
stream_set_timeout($this->SMTPConnect$this->SMTPTimeout);
        
$this->setErrorMessage($this->getSMTPData());
        if (
$this->SMTPCrypto === 'tls')
        {
            
$this->sendCommand('hello');
            
$this->sendCommand('starttls');
            
$crypto stream_socket_enable_crypto($this->SMTPConnecttrueSTREAM_CRYPTO_METHOD_TLS_CLIENT);
            if (
$crypto !== true)
            {
                
$this->setErrorMessage(lang('Email.SMTPError'$this->getSMTPData()));
                return 
false;
            }
        }
        return 
$this->sendCommand('hello');
    } 



RE: Mail Class Error - dave friend - 06-12-2020

(06-11-2020, 12:04 PM)68thorby68 Wrote: What cypher is codeigniter 4 mail class using?

The encryption used depends entirely on the setup of the MTA on the server. CodeIgniter only sets up arguments and setting to pass the server's mail software then it's up to that software to handle encrypted connections.


RE: Mail Class Error - dave friend - 06-13-2020

(06-12-2020, 03:35 AM)68thorby68 Wrote: Absolutely sure.

The server maintains two types of connection, SSL and non-SSL.

port 465 for SSL, port 587 for non-SSL.

I have been using this company for over 10 years and for this issue I have spent a lot of time online with their support desk who have been running live traces as I've been executing the code.

What is the mail transport app that you run on your server - Sendmail, Postfix, Exim, other?