@frm.mwz Yeah, I agree that MW should push out emails as fast as it can regardless of deliverability and queuing.
@twisted1919 Here's an interesting thing. I just emailed the present maintainer of PHPmailer (GitHub) and he reverted to me immediately
, such a nice guy, I never expected he would reply. So, here's our conversation -
=====
>
> Hey Marcus,
>
> Hope you're doing great !
>
> I came to know that you're the current maintainer of PHPMailer - congratulations and thanks for that.
>
>
> I'm one of the millions of users who use PHP Mailer in their business applications.
>
> I don't know if this is the way I should reach out to you with my question/doubt
.
>
> Does PHP Mailer support SMTP pipelining ? is there a class/plugin available so that it can queue up multiple emails per connection without needing to instantiate each connection for each submission ?
>
>
> I'm aware of the setting - SMTPKeepAlive. I set that to true but still I can see PHPMailer is making new connections every time it submits an email to the MTA.
>
>
> Thanks in advance
==
Here's the reply
==
It certainly should not reconnect if keepalive is enabled. I just ran the keepalive test from the PHPMailer test suite (see the function called testSmtpKeepAlive) and it generates this output, where you can see keepalive working:
2016-06-20 21:10:42 Connection: opening to localhost:2500, timeout=300, options=array (
)
2016-06-20 21:10:42 Connection: opened
2016-06-20 21:10:42 SERVER -> CLIENT: 220 192.168.1.10 ESMTP SubEthaSMTP null
2016-06-20 21:10:42 CLIENT -> SERVER: EHLO localhost.localdomain
2016-06-20 21:10:42 SERVER -> CLIENT: 250-192.168.1.10
250-8BITMIME
250-AUTH LOGIN
250 Ok
2016-06-20 21:10:42 CLIENT -> SERVER: MAIL FROM:<
unit_test@phpmailer.example.com>
2016-06-20 21:10:42 SERVER -> CLIENT: 250 Ok
2016-06-20 21:10:42 CLIENT -> SERVER: RCPT TO:<
somebody@example.com>
2016-06-20 21:10:42 SERVER -> CLIENT: 250 Ok
2016-06-20 21:10:42 CLIENT -> SERVER: DATA
2016-06-20 21:10:42 SERVER -> CLIENT: 354 End data with <CR><LF>.<CR><LF>
2016-06-20 21:10:42 CLIENT -> SERVER: Date: Mon, 20 Jun 2016 21:10:42 +0000
2016-06-20 21:10:42 CLIENT -> SERVER: To: Test User <
somebody@example.com>
2016-06-20 21:10:42 CLIENT -> SERVER: From: Unit Tester <
phpunit@example.com>
2016-06-20 21:10:42 CLIENT -> SERVER: Reply-To: Reply Guy <
no_reply@phpmailer.example.com>
2016-06-20 21:10:42 CLIENT -> SERVER: Subject: Unit Test: SMTP keep-alive 1
2016-06-20 21:10:42 CLIENT -> SERVER: Message-ID: <00cce84f42d4d6472d1ea4d52d562c34@Oc.local>
2016-06-20 21:10:42 CLIENT -> SERVER: X-Priority: 3
2016-06-20 21:10:42 CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.16 (
https://github.com/PHPMailer/PHPMailer)
2016-06-20 21:10:42 CLIENT -> SERVER: MIME-Version: 1.0
2016-06-20 21:10:42 CLIENT -> SERVER: Content-Type: text/plain; charset=iso-8859-1
2016-06-20 21:10:42 CLIENT -> SERVER:
2016-06-20 21:10:42 CLIENT -> SERVER: SMTP keep-alive test.
2016-06-20 21:10:42 CLIENT -> SERVER: ---------------------
2016-06-20 21:10:42 CLIENT -> SERVER: Unit Test Information
2016-06-20 21:10:42 CLIENT -> SERVER: ---------------------
2016-06-20 21:10:42 CLIENT -> SERVER: phpmailer version: 5.2.16
2016-06-20 21:10:42 CLIENT -> SERVER: Content Type: text/plain
2016-06-20 21:10:42 CLIENT -> SERVER: CharSet: iso-8859-1
2016-06-20 21:10:42 CLIENT -> SERVER: Host: localhost
2016-06-20 21:10:42 CLIENT -> SERVER: Changes
2016-06-20 21:10:42 CLIENT -> SERVER: -------
2016-06-20 21:10:42 CLIENT -> SERVER: - Sender was changed to [
unit_test@phpmailer.example.com]
2016-06-20 21:10:42 CLIENT -> SERVER: - Mailer was changed to [smtp]
2016-06-20 21:10:42 CLIENT -> SERVER: - Port was changed to [2500]
2016-06-20 21:10:42 CLIENT -> SERVER:
2016-06-20 21:10:42 CLIENT -> SERVER:
2016-06-20 21:10:42 CLIENT -> SERVER:
2016-06-20 21:10:42 CLIENT -> SERVER: .
2016-06-20 21:10:42 SERVER -> CLIENT: 250 Ok
2016-06-20 21:10:42 CLIENT -> SERVER: RSET
2016-06-20 21:10:42 SERVER -> CLIENT: 250 Ok
2016-06-20 21:10:42 CLIENT -> SERVER: MAIL FROM:<
unit_test@phpmailer.example.com>
2016-06-20 21:10:42 SERVER -> CLIENT: 250 Ok
2016-06-20 21:10:42 CLIENT -> SERVER: RCPT TO:<
somebody@example.com>
2016-06-20 21:10:42 SERVER -> CLIENT: 250 Ok
2016-06-20 21:10:42 CLIENT -> SERVER: DATA
2016-06-20 21:10:42 SERVER -> CLIENT: 354 End data with <CR><LF>.<CR><LF>
2016-06-20 21:10:42 CLIENT -> SERVER: Date: Mon, 20 Jun 2016 21:10:42 +0000
2016-06-20 21:10:42 CLIENT -> SERVER: To: Test User <
somebody@example.com>
2016-06-20 21:10:42 CLIENT -> SERVER: From: Unit Tester <
phpunit@example.com>
2016-06-20 21:10:42 CLIENT -> SERVER: Reply-To: Reply Guy <
no_reply@phpmailer.example.com>
2016-06-20 21:10:42 CLIENT -> SERVER: Subject: Unit Test: SMTP keep-alive 2
2016-06-20 21:10:42 CLIENT -> SERVER: Message-ID: <8767d9db2003b4722e96d1d0dc3409d6@Oc.local>
2016-06-20 21:10:42 CLIENT -> SERVER: X-Priority: 3
2016-06-20 21:10:42 CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.16 (
https://github.com/PHPMailer/PHPMailer)
2016-06-20 21:10:42 CLIENT -> SERVER: MIME-Version: 1.0
2016-06-20 21:10:42 CLIENT -> SERVER: Content-Type: text/plain; charset=iso-8859-1
2016-06-20 21:10:42 CLIENT -> SERVER:
2016-06-20 21:10:42 CLIENT -> SERVER: SMTP keep-alive test.
2016-06-20 21:10:42 CLIENT -> SERVER: ---------------------
2016-06-20 21:10:42 CLIENT -> SERVER: Unit Test Information
2016-06-20 21:10:42 CLIENT -> SERVER: ---------------------
2016-06-20 21:10:42 CLIENT -> SERVER: phpmailer version: 5.2.16
2016-06-20 21:10:42 CLIENT -> SERVER: Content Type: text/plain
2016-06-20 21:10:42 CLIENT -> SERVER: CharSet: iso-8859-1
2016-06-20 21:10:42 CLIENT -> SERVER: Host: localhost
2016-06-20 21:10:42 CLIENT -> SERVER: Changes
2016-06-20 21:10:42 CLIENT -> SERVER: -------
2016-06-20 21:10:42 CLIENT -> SERVER: - Sender was changed to [
unit_test@phpmailer.example.com]
2016-06-20 21:10:42 CLIENT -> SERVER: - Mailer was changed to [smtp]
2016-06-20 21:10:42 CLIENT -> SERVER: - Port was changed to [2500]
2016-06-20 21:10:42 CLIENT -> SERVER:
2016-06-20 21:10:42 CLIENT -> SERVER:
2016-06-20 21:10:42 CLIENT -> SERVER:
2016-06-20 21:10:42 CLIENT -> SERVER: .
2016-06-20 21:10:42 SERVER -> CLIENT: 250 Ok
2016-06-20 21:10:42 CLIENT -> SERVER: RSET
2016-06-20 21:10:42 SERVER -> CLIENT: 250 Ok
2016-06-20 21:10:42 CLIENT -> SERVER: QUIT
2016-06-20 21:10:42 SERVER -> CLIENT: 221 Bye
2016-06-20 21:10:42 Connection: closed
Are you seeing some other behaviour?
Marcus
==
Looking at the above test info, there's only one EHLO signal for 2 submissions. I sent him my log screenshot. Is there a way to see this connection details somewhere in MW logs ? I used to see that for failed emails. Or is there a way to test the connection like he did, like enabling debugging or verbose ?
Here's another hopeful article :
https://luxsci.com/blog/maximize-your-outbound-email-throughput-how-to-send-more-email-faster.html
I know I'm being a bug to you n the PHPMailer dev, lol, but I would like to see how it performs once the SMTPKeepAlive works as expected before I give up.