Tried everything SMTP connect() failed

Right… It now changed the design of the error message slightly, but didn’t bring anything else besides that.

Great job!
We’ll have to dive deeper.
The dd($mail->ErrorInfo) gives you that error, so now it’s time to put a dd() somewhere else.

I’ll get back to that.

So remember: dd() kills the script and shows some output.
Now it’s time to find the roght spot to find the error.

Should I keep dd($mail->ErrorInfo); in my phpmailer-helper.php file and randomly put dd(); in other php files to try to trigger more information?

No, remove the dd($mail->ErrorInfo); please.

Place a dd() for the parameters that create that $mail variable.
If there something like this:

$mail = new PHPMailer($host, $port, $user, $password, $sslSettings, $debug);

Careful that you’re not pasting your username/password here!

Then i would do:

dd($host, $port, $user, $password, $sslSettings, $debug);

PHPMailer has some debug options, we need to figure out what they are.
In order to debug all the problems we need those ssl / tls / whatever settings you’re using.
And the port, it was 587, i think.

Basically we’re telling PHPMailer:

Hey, this is our stuff, tell us which steps you’re takijg and what you’re running in to while takibg those steps

If I don’t know where to put dd()'s with more specific information I won’t be able to fix this. It seems there’s more $mail strings in the phpmailer_helper.php than any other phpmailer related php file.

I tried putting the dd() there in various different ways and best case scenario I am getting info like this below. It would really be a shame to pull the plug on this program and use something else, but I’m leaning that way unfortunately.

It’s really difficult to find out what’s wrong without proper errors.

phpmailer is trying to send emails through SMTP, but fails.
I saw the result of one of your dd()'s wasnull. What did you dump there?
Have you dumped the host, port and tls/ssl settings before?

You’re trying to send through hotmail/outlook, correct? Time to figure out how to send through gmail?

But i’d rather see those settings for SMTP for non-working situation first.

Next time you dd() show 2 lines anove and 2 lines under that dd() so we know on which line you’ve put the dd().
The result null doesn’t tell much.

put a dd($mail); around line 75.
It will show all variables that make your problem reproducible: host, port, tls, ssl, you name it.

The username and password for your smtp system aren’t important, delete those values.

The fact that “IsSmtp()” isn’t found in phpMailer is just weird. Seems like a different version is used that that phpmailer_helper is counting on.

In that phpmailer_helper.php file line 44.
It says $mail->IsSmtp();

Can you make it:

$mail->isSMTP();

See the difference between IsSmtp() and isSmtp()?
While you’re at it: add this under it:

$mail->SMTPDebug = 2;

This is what you’re trying to accomplish:

//Server settings
    $mail->isSMTP();                                            // Send using SMTP
    $mail->Host       = 'smtp.example.com';                     // Set the SMTP server to send through
    $mail->SMTPAuth   = true;                                   // Enable SMTP authentication
    $mail->Username   = 'your_email@example.com';               // SMTP username
    $mail->Password   = 'your_password';                        // SMTP password
    $mail->SMTPSecure = 'tls'; // Enable TLS encryption
    $mail->Port       = 587;                                    // TCP port to connect to

The dd($mail); on line 75 without the username/password values will help you with that

See the isSMTP() Instead of IsSMTP()?

dd($mail); on line 75 did the trick!!
I removed $mail->isSMTP(); and $mail->SMTPDebug = 2; (I did see the difference in capital I) since it wasn’t giving me any output data with that in.

^ PHPMailer\PHPMailer\PHPMailer {#203
+Priority: null
+CharSet: “UTF-8”
+ContentType: “text/html”
+Encoding: “8bit”
+ErrorInfo: “”
+From: “root@localhost”
+FromName: “Root User”
+Sender: “”
+Subject: “”
+Body: “”
+AltBody: “”
+Ical: “”
#MIMEBody: “”
#MIMEHeader: “”
#mailHeader: “”
+WordWrap: 0
+Mailer: “smtp”
+Sendmail: “/usr/sbin/sendmail”
+UseSendmailOptions: true
+ConfirmReadingTo: “”
+Hostname: “”
+MessageID: “”
+MessageDate: “”
+Host: “smtp-mail.outlook.com
+Port: “587”
+Helo: “”
+SMTPSecure: “tls”
+SMTPAutoTLS: true
+SMTPAuth: true
+SMTPOptions:
+Username: “user”
+Password: “pass”
+AuthType: “”
#oauth: null
+Timeout: 300
+dsn: “”
+SMTPDebug: 0
+Debugoutput: “html”
+SMTPKeepAlive: false
+SingleTo: false
#SingleToArray:
+do_verp: false
+AllowEmpty: false
+DKIM_selector: “”
+DKIM_identity: “”
+DKIM_passphrase: “”
+DKIM_domain: “”
+DKIM_copyHeaderFields: true
+DKIM_extraHeaders:
+DKIM_private: “”
+DKIM_private_string: “”
+action_function: “”
+XMailer: “”
#smtp: null
#to:
#cc:
#bcc:
#ReplyTo:
#all_recipients:
#RecipientsQueue:
#ReplyToQueue:
#attachment:
#CustomHeader:
#lastMessageID: “”
#message_type: “”
#boundary:
#language:
#error_count: 0
#sign_cert_file: “”
#sign_key_file: “”
#sign_extracerts_file: “”
#sign_key_pass: “”
#exceptions: false
#uniqueid: “”
}

1 Like

Make it isSMTP(), phpMailer will need it.
Keep that debug=2
It will prevent you having to go inside phpMailer and put dd()'s there

Let’s work with those 2 and see the results.
I just hope IsSMTP() was the problem

Alright, I got it all in now. This on line 44 and 45.

 $mail->isSMTP();
 $mail->SMTPDebug = 2;

This on line 76 now

 dd($mail);

It now gives me the same output as sent in my previous message. So far so good, right?

Yes, definitely.
Remove your dd($mail); and let’s see if there are any errors.

For your information: I’ve merged the isSmtp() solution, which means you’ll get credited in the changelog, once we make a new release

Removing dd($mail); gets me back to the good ol’ error:

Let me drop my phpmailer_helper.php in here - in case you see anything out of the ordinary:

<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');

/*
 * InvoicePlane
 *
 * @author		InvoicePlane Developers & Contributors
 * @copyright	Copyright (c) 2012 - 2018 InvoicePlane.com
 * @license		https://invoiceplane.com/license.txt
 * @link		https://invoiceplane.com
 */

/**
 * @param $from
 * @param $to
 * @param $subject
 * @param $message
 * @param null $attachment_path
 * @param null $cc
 * @param null $bcc
 * @param null $more_attachments
 * @return bool
 */
function phpmail_send(
    $from,
    $to,
    $subject,
    $message,
    $attachment_path = null,
    $cc = null,
    $bcc = null,
    $more_attachments = null
) {
    $CI = &get_instance();
    $CI->load->library('crypt');

    // Create the basic mailer object
    $mail = new \PHPMailer\PHPMailer\PHPMailer();
    $mail->CharSet = 'UTF-8';
    $mail->isHTML();

    switch (get_setting('email_send_method')) {
        case 'smtp':
            $mail->isSMTP();
            $mail->SMTPDebug = 2;

            // Set the basic properties
            $mail->Host = get_setting('smtp_server_address');
            $mail->Port = get_setting('smtp_port');

            // Is SMTP authentication required?
            if (get_setting('smtp_authentication')) {
                $mail->SMTPAuth = true;

                $decoded = $CI->crypt->decode($CI->mdl_settings->get('smtp_password'));
				
                $mail->Username = get_setting('smtp_username');
                $mail->Password = $decoded;
            }

            // Is a security method required?
            if (get_setting('smtp_security')) {
                $mail->SMTPSecure = get_setting('smtp_security');
            }

            // Check if certificates should not be verified
            if (!get_setting('smtp_verify_certs', true)) {
                $mail->SMTPOptions = array(
                    'ssl' => array(
                        'verify_peer' => false,
                        'verify_peer_name' => false,
                        'allow_self_signed' => true
                    )
                );
            }

            break;
        case 'sendmail':
            $mail->IsMail();
            break;
        case 'phpmail':
        case 'default':
            $mail->IsMail();
            break;
    }

    $mail->Subject = $subject;
    $mail->Body = $message;
    $mail->AltBody = $mail->normalizeBreaks($mail->html2text($message));

    if (is_array($from)) {
        // This array should be address, name
        $mail->setFrom($from[0], $from[1]);
    } else {
        // This is just an address
        $mail->setFrom($from);
    }

    // Allow multiple recipients delimited by comma or semicolon
    $to = (strpos($to, ',')) ? explode(',', $to) : explode(';', $to);

    // Add the addresses
    foreach ($to as $address) {
        $mail->addAddress($address);
    }

    if ($cc) {
        // Allow multiple CC's delimited by comma or semicolon
        $cc = (strpos($cc, ',')) ? explode(',', $cc) : explode(';', $cc);

        // Add the CC's
        foreach ($cc as $address) {
            $mail->addCC($address);
        }
    }

    if ($bcc) {
        // Allow multiple BCC's delimited by comma or semicolon
        $bcc = (strpos($bcc, ',')) ? explode(',', $bcc) : explode(';', $bcc);
        // Add the BCC's
        foreach ($bcc as $address) {
            $mail->addBCC($address);
        }
    }

    if (get_setting('bcc_mails_to_admin') == 1) {
        // Get email address of admin account and push it to the array
        $CI->load->model('users/mdl_users');
        $CI->db->where('user_id', 1);
        $admin = $CI->db->get('ip_users')->row();
        $mail->addBCC($admin->user_email);
    }

    // Add the attachment if supplied
    if ($attachment_path && get_setting('email_pdf_attachment')) {
        $mail->addAttachment($attachment_path);
    }
    // Add the other attachments if supplied
    if ($more_attachments) {
        foreach ($more_attachments as $paths) {
            $mail->addAttachment($paths['path'], $paths['filename']);
        }
    }

    // And away it goes...
    if ($mail->send()) {
        $CI->session->set_flashdata('alert_success', 'The email has been sent');
        return true;
    } else {
        // Or not...
        $CI->session->set_flashdata('alert_error', $mail->ErrorInfo);
        return false;
    }

}

You can also set $mail->smtpDebug to 3

near your $mail->isSMTP();

place this:

$mail->Debugoutput = function($str, $level) {
    echo "debug level $level; message: $str";
};

We can also make it write to the log file:

$mail->Debugoutput = 'error_log'
and i’m interested in this one
$mail->Debugoutput = 'html'

Now it shows:

    switch (get_setting('email_send_method')) {
        case 'smtp':
            $mail->isSMTP();
            $mail->SMTPDebug = 3;
            $mail->Debugoutput = function($str, $level) {
    		echo "debug level $level; message: $str";
};

Unfortunately it didn’t add anything new to the Invoiceplane log it seems.

There’s multiple logs in MAMP. I got:
apache_error.log
cloud_mamp.log
mysql_error.log
php_error.log

I’ll post their latest info below:

apache_error.log
Perl/v5.30.1 configured -- resuming normal operations
[Thu Oct 31 22:17:52.090620 2024] [core:notice] [pid 25427] AH00094: Command line: '/Applications/MAMP/Library/bin/httpd'
[Thu Nov 14 12:15:04.901102 2024] [mpm_prefork:notice] [pid 25427] AH00169: caught SIGTERM, shutting down
[Thu Nov 14 12:15:11.440564 2024] [:notice] [pid 58251] FastCGI: process manager initialized (pid 58251)
[Thu Nov 14 12:15:11.443160 2024] [mpm_prefork:notice] [pid 58245] AH00163: Apache/2.4.54 (Unix) OpenSSL/1.0.2u PHP/7.4.33 mod_wsgi/3.5 Python/2.7.18 mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_perl/2.0.11 Perl/v5.30.1 configured -- resuming normal operations
[Thu Nov 14 12:15:11.443512 2024] [core:notice] [pid 58245] AH00094: Command line: '/Applications/MAMP/Library/bin/httpd'
cloud_error.log
is empty
mysql_error.log
2024-11-14T17:15:06.6NZ mysqld_safe Logging to '/Applications/MAMP/logs/mysql_error.log'.
2024-11-14T17:15:06.6NZ mysqld_safe Starting mysqld daemon with databases from /Applications/MAMP/db/mysql57
2024-11-14T17:15:06.476054Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2024-11-14T17:15:06.476515Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2024-11-14T17:15:06.476526Z 0 [Note] /Applications/MAMP/Library/bin/mysqld (mysqld 5.7.39) starting as process 58185 ...
2024-11-14T17:15:06.483028Z 0 [Warning] Setting lower_case_table_names=2 because file system for /Applications/MAMP/db/mysql57/ is case insensitive
2024-11-14T17:15:06.487616Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2024-11-14T17:15:06.487628Z 0 [Note] InnoDB: Uses event mutexes
2024-11-14T17:15:06.487633Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2024-11-14T17:15:06.487638Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-11-14T17:15:06.488259Z 0 [Note] InnoDB: Number of pools: 1
2024-11-14T17:15:06.488931Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2024-11-14T17:15:06.489777Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2024-11-14T17:15:06.493455Z 0 [Note] InnoDB: Completed initialization of buffer pool
2024-11-14T17:15:06.508884Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2024-11-14T17:15:06.535301Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2024-11-14T17:15:06.535398Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2024-11-14T17:15:06.544247Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2024-11-14T17:15:06.544555Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2024-11-14T17:15:06.544562Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2024-11-14T17:15:06.544676Z 0 [Note] InnoDB: Waiting for purge to start
2024-11-14T17:15:06.599313Z 0 [Note] InnoDB: 5.7.39 started; log sequence number 3290106
2024-11-14T17:15:06.599807Z 0 [Note] InnoDB: Loading buffer pool(s) from /Applications/MAMP/db/mysql57/ib_buffer_pool
2024-11-14T17:15:06.599881Z 0 [Note] Plugin 'FEDERATED' is disabled.
2024-11-14T17:15:06.604650Z 0 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
2024-11-14T17:15:06.604669Z 0 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
2024-11-14T17:15:06.614676Z 0 [Note] InnoDB: Buffer pool(s) load completed at 241114 12:15:06
2024-11-14T17:15:06.621940Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2024-11-14T17:15:06.621958Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2024-11-14T17:15:06.621965Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2024-11-14T17:15:06.621969Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2024-11-14T17:15:06.623867Z 0 [Warning] CA certificate ca.pem is self signed.
2024-11-14T17:15:06.623924Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2024-11-14T17:15:06.624196Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2024-11-14T17:15:06.624356Z 0 [Note] IPv6 is available.
2024-11-14T17:15:06.624364Z 0 [Note]   - '::' resolves to '::';
2024-11-14T17:15:06.624380Z 0 [Note] Server socket created on IP: '::'.
2024-11-14T17:15:06.630489Z 0 [Warning] Insecure configuration for --pid-file: Location '/Applications/MAMP/tmp' in the path is accessible to all OS users. Consider choosing a different directory.
2024-11-14T17:15:06.649926Z 0 [Warning] Optional native table 'performance_schema'.'processlist' has the wrong structure or is missing.
2024-11-14T17:15:06.650402Z 0 [Note] Event Scheduler: Loaded 0 events
2024-11-14T17:15:06.650455Z 0 [Note] /Applications/MAMP/Library/bin/mysqld: ready for connections.
Version: '5.7.39'  socket: '/Applications/MAMP/tmp/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)
2024-11-14T17:15:21.711163Z 9 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
2024-11-14T17:15:21.711205Z 9 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
2024-11-14T17:15:28.440468Z 16 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
2024-11-14T17:15:28.440511Z 16 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
2024-11-14T17:15:28.442417Z 16 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
2024-11-14T17:15:28.442441Z 16 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
2024-11-14T17:39:54.312928Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1050313ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T17:42:17.338907Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 139012ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T17:59:28.779190Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1022448ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T18:15:31.849847Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 958032ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T18:31:16.948337Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 940068ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T18:48:53.992167Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1052017ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T19:05:46.019848Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1005997ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T19:21:44.037483Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 953010ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T19:38:41.253575Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1013217ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T19:49:07.458667Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 621180ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T20:05:49.074350Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 995586ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T20:06:16.113942Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 12038ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T20:10:18.239807Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 236089ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T20:16:00.830099Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 336568ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T20:33:13.932158Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1026055ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T20:49:12.073501Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 954131ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T21:05:43.025861Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 985944ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T21:22:48.974890Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1020931ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T21:24:41.056775Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 107051ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T21:26:53.682054Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 126582ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T21:33:31.649187Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 390929ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T21:35:55.130002Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 137454ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T21:36:11.401911Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 10230ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T21:38:31.448689Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 133997ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T21:39:20.994893Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 42501ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T21:40:17.851256Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 50810ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T21:46:59.462655Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 395578ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T21:47:28.033072Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 22526ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T21:59:10.984248Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 695911ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T22:02:56.456514Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 219436ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T22:05:49.447442Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 166946ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T22:09:41.505983Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 226025ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T22:10:28.311659Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 39762ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T22:16:20.111044Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 345762ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T22:17:07.721824Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 41568ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T22:17:59.280770Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 45535ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T22:18:11.956302Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 5641ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T22:26:51.467412Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 513465ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T22:43:15.861524Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 978358ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T22:56:46.426245Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 805529ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T23:11:51.719984Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 899262ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T23:28:23.678664Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 986938ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-14T23:44:41.375699Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 972665ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T00:01:48.376078Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1021962ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T00:17:58.517676Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 966116ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T00:34:33.513228Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 989971ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T00:52:35.545177Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1077009ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T00:59:17.922218Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 397364ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T01:14:46.333408Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 922380ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T01:30:55.389242Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 964018ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T01:48:54.306991Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1073901ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T02:03:12.829217Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 853486ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T02:15:21.693060Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 722819ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T02:31:00.891786Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 932153ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T02:46:16.571566Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 911657ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T02:50:03.884824Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 222277ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T03:00:00.697670Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 590758ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T03:17:18.143956Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1031405ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T03:34:46.171892Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1042999ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T03:52:44.189886Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1072999ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T04:08:43.185208Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 953973ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T04:24:53.204412Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 964994ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T04:40:20.202040Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 922022ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T04:56:53.148971Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 986776ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T05:13:38.101322Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 999990ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T05:15:05.467228Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 80374ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T05:30:41.227562Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 929725ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T05:46:51.212183Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 964961ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T06:03:53.157573Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1016917ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T06:18:58.191215Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 900002ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T06:35:17.214054Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 973980ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T06:52:09.274807Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1007018ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T07:07:38.439352Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 925123ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T07:24:18.484702Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 995014ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T07:41:35.531771Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1032015ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T07:58:55.466655Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1034909ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T08:14:01.517100Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 901028ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T08:30:03.482890Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 956951ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T08:47:12.474752Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1023959ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T09:04:16.467411Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1018957ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T09:15:06.660514Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 645148ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T09:31:03.258181Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 950567ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T09:47:07.311498Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 959026ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T10:05:09.295632Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1076943ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T10:23:11.275190Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1076950ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T10:39:35.305142Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 978998ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T10:54:45.364703Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 905017ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T11:12:17.416700Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1047025ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T11:29:49.532085Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1047083ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T11:44:07.290871Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 851734ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T11:59:52.911636Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 939588ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T12:16:33.944286Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 995999ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T12:33:41.960176Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1022995ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T12:48:47.025581Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 900046ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T13:04:36.538073Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 944490ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T13:21:17.573066Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 996034ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T13:27:38.836950Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 376220ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T14:00:33.868392Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1061840ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T14:01:06.754756Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 27859ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T14:03:27.498527Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 134714ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T14:19:49.278926Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 975747ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T14:37:37.785378Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1061476ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T14:52:48.801650Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 905985ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T15:08:38.851960Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 945017ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T15:26:24.048165Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1061195ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T15:41:29.063234Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 899986ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T15:51:36.223657Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 601064ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T16:01:18.843935Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 139027ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T16:18:54.010721Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1026174ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T16:34:47.076674Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 948045ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T16:51:54.126768Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1022028ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T17:08:56.118220Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1016964ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T17:26:12.859499Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1030761ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T17:44:12.873054Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1075001ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T18:02:12.901195Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1075001ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T18:19:16.994306Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1019057ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T18:35:16.990768Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 954954ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T18:51:30.009045Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 967980ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T18:53:38.482631Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 123510ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T20:53:06.240203Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 1004463ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T21:09:43.691109Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 949348ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2024-11-15T22:51:37.206468Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 712389ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
php_error.log
[22-Oct-2024 01:37:47 UTC] PHP Fatal error:  Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.33. in /Applications/MAMP/htdocs/invoices2/vendor/composer/platform_check.php on line 24
[22-Oct-2024 01:39:05 UTC] PHP Fatal error:  Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.33. in /Applications/MAMP/htdocs/invoices2/vendor/composer/platform_check.php on line 24
1 Like

Ok, make it error_log or html
~I’ll check tomorrow how to write it to InvoicePlane’s log~

Don’t know where to put $mail->Debugoutput = 'error_log'.

You need to test the different things here:
Right now you have:

$mail->Debugoutput = function($str, $level) {
    		echo "debug level $level; message: $str";

You can make it:

$mail->Debugoutput = 'html';

or

$mail->Debugoutput = 'echo';

Or you can make it:

$mail->Debugoutput = function($str, $level) {
    log_message('debug', gmdate('Y-m-d H:i:s') . ' ' . $str);
};

Or just simply:

$mail->Debugoutput = function($str, $level) {
    log_message('debug', $str);
};

Those 2 will add your error to the InvoicePlane log.
Either with a timestamp or without it (log_message might give its own timestamp)

let’s hope log level 3 gives a bit more information