Laminas\Mail\Protocol\Exception\RuntimeException error

These are lines which I edited to configure the smtp settings from settings.php. Something must be wrong that sending mesages or liking a post causes error "Laminas\Mail\Protocol\Exception\RuntimeException". 

---

/**
 * Configure emailer transport
 *
 * This setting can be used to select a different emailer transport. By default the Laminas Sendmail Transport is used.
 * Currently only 'smtp' and 'sendmail' are supported as a different configuration.
 * For 'smtp', the SMTP server's settings must be set, while 'sendmail' requires no configuration.
 *
 * @global string $CONFIG->emailer_transport
 */

$CONFIG->emailer_transport = 'smtp';

/**
 * Configure sendmail related settings
 */

$CONFIG->emailer_sendmail_settings = 'smtp';

/**
 * Configure emailer SMTP settings
 *
 * This setting is only necessary if the above emailer transport is set to 'smtp'.
 * Please refer to https://docs.laminas.dev/laminas-mail/transport/smtp-options/#configuration-options
 * and https://docs.laminas.dev/laminas-mail/transport/smtp-authentication/#examples
 */

$CONFIG->emailer_smtp_settings = array(
// 'name'              => 'localhost.localdomain',
'host'              => 'ni-chrome.guzelhosting.com',
'port'              => 465,
'connection_class'  => 'login',
'connection_config' => [
'username' => 'noreply@ahalim.com',
'password' => '*******',
'ssl'      => 'tls', // OPTIONAL (tls or ssl)
'port'     => '587', // OPTIONAL (Non-SSL default 25, SSL default 465, TLS default 587)
// 'use_complete_quit' => '', // OPTIONAL
],
);

---

My coding experience is poor.  I need your help. The error log belong this is below

Laminas\Mail\Protocol\Exception\RuntimeException: Could not read from ni-chrome.guzelhosting.com in .../.../ahalim.com/vendor/laminas/laminas-mail/src/Protocol/AbstractProtocol.php:298

Stack trace:

#0 .../.../ahalim.com/vendor/laminas/laminas-mail/src/Protocol/AbstractProtocol.php(326): Laminas\Mail\Protocol\AbstractProtocol->_receive(300)

#1 .../.../ahalim.com/vendor/laminas/laminas-mail/src/Protocol/Smtp.php(277): Laminas\Mail\Protocol\AbstractProtocol->_expect(Array, 300)

#2 .../.../ahalim.com/vendor/laminas/laminas-mail/src/Transport/Smtp.php(396): Laminas\Mail\Protocol\Smtp->helo('localhost')

#3 .../.../ahalim.com/vendor/laminas/laminas-mail/src/Transport/Smtp.php(378): Laminas\Mail\Transport\Smtp->connect()

#4 .../.../ahalim.com/vendor/laminas/laminas-mail/src/Transport/Smtp.php(389): Laminas\Mail\Transport\Smtp->lazyLoadConnection()

  • After upgrading to 5.1.8, Creating a new user or liking a post produce the error "Laminas\Mail\Protocol\Exception\RuntimeException" again

    We need more information. This can be done if you enable error logging:

    Turn on 'Debugging and Logging - Log level: Log errors and warning' option (Dashboard -> Site settings) /admin/site_settings

    Reproduce the situation and check the server logs.

    You can use Elgg Developer Tools plugin as well: turn on "Enable error log" option, reproduce the situation and check /admin/develop_tools/error_log page

    Another problem is that I can't check the errol log. It produces "Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 2539520 bytes)

    Try to increase your memory size: 1, 2 and more

  • I have changed it and iincreased it (php_value memory_limit) to 256M from 128. 

    and now I still can't reach the page and it displays the error below

    Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 101965824 bytes) in /home/buradan4/ahalim.com/vendor/elgg/elgg/views/default/page/layouts/elements/content.php on line 8

     

  • Try to do this in php.ini (cli and fpm both) as well:

    memory_limit = 256M

    Don't forget to restart Apache and php-fpm services after these changes.

  • Nikolai,

    Hi again. I requested the hosting service to increase the php limits. They informed me that The memory_limit value on the hosting service is already selected as 256MB. They made this limit selected as the maximum value of 512MB and other PHP limits are also set to maximum. 

    But when I try to display error log I still get "Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 103526400 bytes) in /home/buradan4/ahalim.com/vendor/elgg/elgg/views/default/page/layouts/elements/content.php on line 8"

  • Whatever I did, it didn't work.

    I still get the error "Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 137998336 bytes) in /home/buradan4/ahalim.com/vendor/elgg/elgg/views/default/page/layouts/elements/body.php on line 14"

    There must be something wrong. I can't reach the page of Error Log. So no evidence what causes ""Laminas\Mail\Protocol\Exception\RuntimeException"  eror.

    it seems that this is the end of hoping a solution to overcome my smtp setting problem..

    Thanks anyway.

     

     

  • You restarted Apache and PHP after the changes, right?

    If yes, then no ideas ¯\_(ツ)_/¯

     

  • I canceled the 25 defined port with //. I changed the other 587 defined port to "465" in settings.php. But the problem still persists. When I like, or when an operation is performed via email such as registration or forgotten password, it seems that the operation takes a long time and eventually gives the error "Laminas\Mail\Protocol\Exception\RuntimeException".
    I sent the configuration to the hosting service, they sent the settings for the hosting name and the port is ok. So "host"  and "port"  is verified by the hosting. "username" and "password" are also the ones which I described myself. Even I cut and paste to avoid from spelling mistake. 
    The only thing I am thinking about there must be a bug that has been overlooked. 
    One more thing, after the error message, when I refresh the page, it appears that the like has been processed.
     
    My site's SMTP configuration in "settings.ini" is as below.
     
    ....
    $CONFIG->emailer_transport = 'smtp';
     
    /**
     * Configure sendmail related settings
     */
    $CONFIG->emailer_sendmail_settings = '';
     
    /**
     * Configure emailer SMTP settings
     *
     * This setting is only necessary if the above emailer transport is set to 'smtp'.
     */
    $CONFIG->emailer_smtp_settings = array(
    'name'              => 'localhost.localdomain',
    'host'              => 'ni-chrome.guzelhosting.com',
    'port'              => '465',
    'connection_class'  => 'login',
    'connection_config' => [
    'username' => 'noreply@ahalim.com',
    'password' => 'DrB@08UsD&fY',
    // 'ssl'      => 'tls', // OPTIONAL (tls or ssl)
    //'port'     => '465', // OPTIONAL (Non-SSL default 25, SSL default 465, TLS default 587)
    //'use_complete_quit' => '', // OPTIONAL
     ],
    );
    ....
  • At last my issue has been solved. It was because of my hosting service. They said "When we review, it appears that your noreply@ahalim.com email address has been blocked. The reason for the blocking is that bulk and spam emails were sent from the relevant email address on March 1. The blocking has been lifted. We kindly ask you to double-check."

    Now I wonder what kind of spam caused the issue. I didn't do anything on the date such as sending mails in mass!