Welcome Guest, Not a member yet? Register   Sign In
Mail Class Error
#1

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:
Reply
#2

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

(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']));
Reply
#4

Are you sure the port number is 465?

Some SMTP server also use port 587.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#5

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.
Reply
#6

(This post was last modified: 06-12-2020, 08:39 AM by jreklund.)

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');
    } 
Reply
#7

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

(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?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB