Need email help from an expert

Hi, I’m stuck. Using the latest V4, I just did a fresh install for the first time and I can’t get emails to work.

I have a separate email server with Mailcheap (just a basic shared account) as I did not want to manage any email daemons / accounts / files on my web servers.

The account with Mailcheap is not necessarily an SMTP service… again, I did not want to learn to become an email protocol expert, so I don’t know the details of their implimenation.

By default I could not get emails to send from WordPress either, but somehow the plugin WP Mail SMTP fixes that problem and my emails get sent. All I have to do is input the same information that I’ve input into the InvoiceNinja settings – literally all of the exact same fields under Email Settings.

So I’m wondering, what is the magic trick that WP Mail SMTP is employing? Do any experts know? And how could I apply it to my instance of InvoiceNinja?

When I run the “Send test email” button with SMTP selected, I get a timeout:

Connection could not be established with host mail14.mymailcheap.com [Connection timed out #110]

  • Yes port 587 is open in my firewall.
  • The host is in fact mail14.mymailcheap.com
  • I’m using TLS, works fine with my WordPress sites

When I change the Driver to “Mail” I get a more immediate failure:

Expected response code 220 but got an empty response

If it helps, here are the DNS records I use for my WordPress sites (and this instance):

MX mail14.mymailcheap.com TTL 1800 Priority 1
MX alt1.mymailcheap.com TTL 1800 Priority 5
MX alt2.mymailcheap.com TTL 1800 Priority 10

NS ns1.vultr.com TTL 300
NS ns2.vultr.com TTL 300

TXT "v=spf1 mx a:relay.mymailcheap.com -all" TTL 1800
TXT _dmarc "v=DMARC1; p=none" TTL 1800

I don’t recall having to make any changes to my Mailcheap settings to get my WordPress sites to send emails. It must come down to something in the PHP, which that WP plugin seems to fix. Any ideas?

It’s not ModSecurity either, I’ve disabled it and I get the same error.

Quick follow up: it seems that port 587 might be blocked by my VPS provider Vultr. I will try to contact support to confirm this. What’s strange is, how does that WP Mail SMTP plugin end up sending out emails if that port’s been blocked all along?..

Are you able to telnet to the host on port 587 from the server? It’s a useful way to ensure the host/port is actually reachable.

Hi, yes I actually tried it right before I contacted Vultr, and it appeared to be blocked. Vultr support confirms that by default they block it. They might open it - it’s case by case - but I’m more interested in how that WP Mail SMTP plugin manages to send out emails for my WordPress sites if that port is blocked. Mainly, if it’s more simple to implement than having to run and configure something like Postfix.

Sorry, I can’t answer that. If the port is blocked I don’t see how it would work?

I’ll explore that plugin’s support forum to see if they’re willing to offer any guidance. I didn’t want to learn all the dry email protocol stuff but I may just have to :sweat_smile:

I opened up port 465 and changed to SSL encryption and it works :man_facepalming:

I was under the impression that my Mailcheap service wouldn’t connect under SSL, but what do I know, maybe my memory was wrong or their new system now allows it.

If this was at all helpful to anyone trying to set up I.N. on a Vultr VPS, there you go.