Unable to get SMTP2Go Plugin to Work

I have done the following:

Installed 3.6.10 and got it working with a local SMTP server. Discovered that my hosting provider limits outbound emails via SMTP. Discovered the PHPList SMTP2Go plugin.

Installed the SMPT2Go Plugin. Activated it and the Common plugin.

Opened an account on SMTP2Go. Went through their process to be a verified sender. Generated the API key.

Back on PHPList I updated the SMTP2Go plugin settings with the API key from SMTP2Go. Left the API Base URL as https://api.smtp2go.com/v3/

Then I went down a rabbit hole, based on an SMTP2Go document, and configured SMTP to use an SMTP userid. After about an hour I realized I was just trying to use SMTP and that wouldn’t work with my vendor.

Modified the config.php and commented out all of the SMTP related defines. I made sure that the SMTP2Go plugin was enabled and double checked the API Key was configured. All other values left with defaults.

Started a campaign and tried to send a test message. It said that the message had been sent successfully. The message never arrived.

Sent the campaign to a test list. “Log of events” says that 7 messages were sent. Nothing arrived.

There are no errors in the php error_log.

On SMTP2Go, the reports say that no emails have been sent.

I have run out of ideas how to troubleshoot this.

@jmtphplist Just tried the plugin and it works for me sending a test email.

Have you configured a verified sender in SMTP2GO?

Yes. I did configure a verified sender.

Are there any logs besides the “Log of events”. What else can I check? I don’t doubt that the plugin works but I suspect that something isn’t configured correctly. But PHPList says it is sending but SMTP2Go says nothing was received.

@jmtphplist You can generate verbose curl output, by selecting that on the Settings page. There should then be a log file in the directory identified by the variable $tmpdir in the phplist config.php file. If that is not set, then set it to a directory to which the web server can write.

Created a new campaign then tried to send a test message. The curl log follows:

  • Trying 104.237.148.81:443…
  • Connected to api.smtp2go.com (104.237.148.81) port 443 (#0)
  • ALPN: offers h2
  • ALPN: offers http/1.1
  • CAfile: /etc/pki/tls/certs/ca-bundle.crt
  • CApath: none
  • SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
  • ALPN: server did not agree on a protocol. Uses default.
  • Server certificate:
  • subject: CN=*.smtp2go.com
  • start date: Aug 15 00:00:00 2022 GMT
  • expire date: May 30 23:59:59 2023 GMT
  • subjectAltName: host “api.smtp2go.com” matched cert’s “*.smtp2go.com”
  • issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo RSA Domain Validation Secure Server CA
  • SSL certificate verify ok.

POST /v3/email/mime HTTP/1.1^M
Host: api.smtp2go.com^M
User-Agent: phpList (phpList version 3.6.10, http://www.phplist.com/)^M
Accept: /^M
Content-Type: application/json^M
Content-Length: 13348^M
^M

  • old SSL session ID is stale, removing
  • Mark bundle as not supporting multiuse
    < HTTP/1.1 200 OK^M
    < access-control-max-age: 3600^M
    < content-length: 354^M
    < content-type: application/json^M
    < date: Wed, 30 Nov 2022 21:48:22 GMT^M
    < connection: close^M
    < ^M
  • Closing connection 0

A 200 return code means that it was successful, according to the SMTP2GO documentation SMTP2GO | API Documentation

but the content length of 354 is appreciably larger than that in my log, which is 141. Not sure whether that is significant.

Is there a way to see what was returned? According to the SMTP2Go doc there should be details about what was sent, etc.

@jmtphplist There wasn’t but I have just added that. You need to upgrade Common Plugin on the Manage Plugins page, and add this to config.php

$log_options = [
    'threshold' => 'DEBUG',
    'classes' => [
        'phpList\plugin\Common\MailSender' => true,
    ]
];

A different log file named log_2022-11-30.txt should be created in the $tmpdir directory showing the return code and response.

Success. I changed the plugin settings for the SMTP2Go Plugin for as follows:
Whether to use multi-curl to send emails concurrently - Yes
The maximum number of emails to send concurrently when using multi-curl, (between 2 and 32) - 4 (default)

With those settings it is working.

@jmtphplist Good but I don’t know why it is different. If you do have time to look at generating a log file for the first case I’d be interested in seeing what is contained in the response.

The multi-curl doesn’t have that logging. The setting for log file for multi-curl transfers just logs the time taken for each request.