Documentation

✉️ Email Delivery

Documentation, reference material and tutorials for CRM-NG SMTP Email: setup guides for every mail service, troubleshooting, and one article per error message.

Error: Hostname could not be resolved

Updated

By Duane GarnerChief Executive Officer (CEO)
Summarize: Claude ChatGPT View Markdown
On this page

Your web server could not turn the mail server's name into an address. Check the host name for typos, then ask your host about DNS.

Shown mostly by the Other SMTP and Zoho Mail mailers (any mailer when the server's DNS is broken)

The test result or the error log shows a message such as php_network_getaddresses: getaddrinfo failed: Name or service not known or hostname could not be resolved.

This article is for site owners who see a name lookup failure when sending. It is most common with Other SMTP, but any mailer can show it if the web server cannot look up names.

What this error means

To connect to a mail server, your web server first asks DNS for the IP address behind its name, for example smtp.example.com. "Could not be resolved" and "getaddrinfo failed" mean that lookup returned nothing. The connection never started, so the mail server never saw the request.

Either the name is wrong, or the name is right but your web server cannot reach a working DNS resolver.

Common causes

  • A typo in SMTP Host, such as smtp.gmial.com or an extra dot.
  • A protocol or port typed into the host field, for example ssl://smtp.example.com or smtp.example.com:587. The host field should hold only the name.
  • A leading or trailing space in SMTP Host.
  • The mail provider changed its server name, or the record was removed from DNS.
  • The web server's own DNS settings are broken or blocked, which is a hosting issue. In that case API mailers fail too, often with a cURL error 6.
  • A firewall on the server blocks outgoing DNS queries.

How to fix

  1. Check the server name at your provider

    Look up the exact SMTP server name in your mail provider's help or admin console. Copy it rather than typing it.

  2. Correct the settings

    Go to CRM-NG SMTP → Settings → General. For Other SMTP, enter only the name in SMTP Host, then set SMTP Port and Encryption in their own fields. For Zoho Mail, check the Data Center choice. Save.

  3. Test the name from outside

    On your own computer, run nslookup smtp.example.com (with your host name). If it returns an address, the name is valid.

  4. Ask your web host

    If the name resolves from your computer but not from the site, ask your host to check the server's DNS resolvers and whether outbound DNS is blocked. Share the error from CRM-NG SMTP → Tools → Debug Events.

  5. Send a test

    Go to CRM-NG SMTP → Tools → Email Test, fill in Send To and press Send Email.

Verify it worked

The test page shows "Test email sent successfully! Check your inbox to confirm delivery." If the error changes to a connection or authentication error, the name now resolves and you have moved on to the next problem.

Notes

  • If every mailer fails, including API ones, the problem is almost certainly on the web server, not in CRM-NG SMTP.
  • Turn on Debug Email Sending in Tools → Debug Events for a short time to capture the full conversation with the server; turn it off afterwards.
Go to Top