Tried everything SMTP connect() failed

Hi all,

I am using InvoicePlane v1.5.11, PHP v7.4.33 and I believe I am using v6.1 PHPMailer, not sure where to check it.

Like many other people on this forum I’m getting this error when I attempt to send an invoice via SMTP: SMTP connect() failed.
I’ve been working with this platform for about 2 years (I run it locally, no hosting services) and barely had any hiccups, but this one I cannot crack. I flew to Europe from the US for a few weeks and couldn’t get the SMTP function to work there and when I got back to the US it, unfortunately, did still not work (it did prior to my trip).

I’ve read Troubleshooting · PHPMailer/PHPMailer Wiki · GitHub. Tried:

  • Triple checked SMTP settings, password etc.
  • Couldn’t get the debugging function ($mail->SMTPDebug = SMTP::DEBUG_SERVER;) to work (any advice on how that works?)
  • dig +short smtp-mail.outlook.com (provides the feedback it should)
  • ping smtp-mail.outlook.com (provides the feedback it should)
  • nc -v smtp-mail.outlook.com 587 (provides the feedback it should)
  • No firewall locally should be blocking
  • Made sure Outlook has SMTP enabled on my account
  • Ran this to check whether that seems to work and it did. “echo QUIT | openssl s_client -starttls smtp -crlf -connect smtp-mail.outlook.com:587

I’ve searched online, searched the forum and I am all out of ideas.

Any proposal to what I can do? The system worked fine for 2 years and then all of a sudden it stops working. I’m not very experienced in this, but I’ll do my best to comprehend whatever you throw at me.

1 Like

I’m guessing you’re using hotmail/outlook?
I’ve once gone through some heavy debugging in that SMTP mail sending long time ago, it’s a pain.

I only know that Microsoft sometimes changes things, i just hope it’s not the caae this time…

SMTP connects with something i call a 'connection string, i just hope that somewhere in there it says something about being connected correctly.

In the development branch i’ve added some extra tools to help you debug the problem.
This branch is still compatible with PHP 7.4

If you run composer install and yarn install && yarn grunt you’ll still have a version that’s compatible with PHP 7.4

Or take a look at the composer.json and just add things like vardump to your own 1.5.11 install

with dd() it will completely die at that point in the code.
You can also do dd($connectionString); which will just give you details

What you’re looking for is the reason why it’s not sending mail.
It should give you some kund of error, at least.

What do you mean by development branch? Where should I look and what tool(s) am I looking for?

This section made no sense to me - are you asking me to add dd($connectionString); to the composer.json code and would it then spit out a log somewhere?:
with dd() it will completely die at that point in the code.
You can also do dd($connectionString); which will just give you details

I fully understand I need to figure out why it’s not sending the email to take care of the issue.

Just tried the gmail smtp as well without luck.

git clone git@github.com:InvoicePlane/InvoicePlane.git ivplv1 and then cd ivplv1 will mean you’re on the development branch of InvoicePlane. It will also give you more tools than you have now in your version 1.5.11.
You’ll need those things to resolve your problem.

Add dd($connectionString); in phpMailer or in one of InvoicePlane’s files that deal with email.
The log that it will spit out is on your screen