SMTP settings for your contact form

Settings checked against each provider's own documentation in November 2026.

If your PHP contact form says a message was sent but nothing arrives, the email settings are almost always the cause. This page lists the settings to use for the most popular web hosts and email services.

The settings go in fcf-config/fcf.settings.php. The examples below use the same setting names as the free forms, but the server names and ports work with any PHP form that sends through SMTP.

Pick your host or email service

Web hosts: GoDaddy IONOS Bluehost OVHcloud Hetzner Namecheap Liquid Web SiteGround DreamHost InMotion HostGator Hostinger

Email services: Gmail / Google Workspace Microsoft 365 / Outlook SendGrid Mailjet Brevo

Host not listed? Read the basics below, or ask your host: "What outgoing SMTP server, port and encryption should a PHP script use to send email from my account?"

The basics, in two minutes

Use an email account on your own domain

Create a mailbox just for the form in your hosting control panel, for example [email protected], and let the form log in to it. Send from that address, not from the visitor's: Gmail, Outlook and others reject mail that claims to come from an address the sending server isn't allowed to use. The free forms set the visitor's address as the reply-to, so pressing Reply still goes to them.

Port and encryption go together

Almost every provider supports one or both of these:

Mixing them up (465 with STARTTLS, or 587 with SMTPS) is one of the most common mistakes, and usually ends in a timeout. If one pair doesn't work, try the other.

On cPanel hosting, use the server's name

Many cPanel hosts suggest mail.yourdomain.com. That only works if your domain points at your hosting. If it points somewhere else, for example through Cloudflare, the form can't connect. The safe choice is the server name: in cPanel it's on the main page as Server Name, or under Email Accounts → Connect Devices in the Secure SSL/TLS Settings box. It also avoids certificate errors, because the server's certificate is issued for that name.

Check your domain's SPF and DKIM

These DNS records tell other mail servers your messages are genuine. Without them, form emails often go to spam. In cPanel, open Email Deliverability and fix anything it flags. See emails going to spam for the full steps, including DMARC.

Still stuck?

Use the form's built-in self-test page, or turn on SMTP debugging to see exactly what the mail server says. See also why form emails don't arrive and the installation guide.


Web hosts

GoDaddy

GoDaddy's shared hosting doesn't let scripts log in to a mailbox. Instead, it provides a relay on the hosting server itself, with no username, password or encryption.

define('USE_SMTP', 'YES');
define('SMTP_HOST', 'localhost');    // Windows hosting: relay-hosting.secureserver.net
define('SMTP_PORT', '25');
define('SMTP_SECURE', '');
define('SMTP_AUTH', 'NO');
define('EMAIL_FROM', '[email protected]');

IONOS (1&1)

define('SMTP_HOST', 'smtp.ionos.co.uk');   // see below for your country
define('SMTP_PORT', '465');
define('SMTP_SECURE', 'SMTPS');            // or port 587 with STARTTLS
define('SMTP_USER', '[email protected]');
define('SMTP_PASS', 'your mailbox password');

Bluehost

define('SMTP_HOST', 'mail.yourdomain.com');  // or the server name from cPanel
define('SMTP_PORT', '465');
define('SMTP_SECURE', 'SMTPS');
define('SMTP_USER', '[email protected]');
define('SMTP_PASS', 'your mailbox password');

OVHcloud

define('SMTP_HOST', 'smtp.mail.ovh.net');  // Americas/Asia-Pacific: smtp.mail.ovh.ca
define('SMTP_PORT', '465');
define('SMTP_SECURE', 'SMTPS');            // or port 587 with STARTTLS
define('SMTP_USER', '[email protected]');
define('SMTP_PASS', 'your mailbox password');

Hetzner

define('SMTP_HOST', 'mail.your-server.de');  // exactly as written
define('SMTP_PORT', '587');
define('SMTP_SECURE', 'STARTTLS');
define('SMTP_USER', '[email protected]');
define('SMTP_PASS', 'your mailbox password');

Namecheap

Namecheap sells two kinds of email, with different settings.

Email included with shared hosting (cPanel):

define('SMTP_HOST', 'server123.web-hosting.com');  // your server name from cPanel
define('SMTP_PORT', '465');
define('SMTP_SECURE', 'SMTPS');            // or port 587 with STARTTLS
define('SMTP_USER', '[email protected]');
define('SMTP_PASS', 'your mailbox password');

Namecheap Private Email:

define('SMTP_HOST', 'mail.privateemail.com');
define('SMTP_PORT', '465');
define('SMTP_SECURE', 'SMTPS');            // or port 587 with STARTTLS
define('SMTP_USER', '[email protected]');
define('SMTP_PASS', 'your mailbox password');

Liquid Web

define('SMTP_HOST', 'host.yourdomain.com');  // your server's hostname
define('SMTP_PORT', '465');
define('SMTP_SECURE', 'SMTPS');            // or port 587 with STARTTLS
define('SMTP_USER', '[email protected]');
define('SMTP_PASS', 'your mailbox password');

SiteGround

define('SMTP_HOST', 'mail.yourdomain.com');  // or the exact name from Site Tools
define('SMTP_PORT', '465');
define('SMTP_SECURE', 'SMTPS');
define('SMTP_USER', '[email protected]');
define('SMTP_PASS', 'your mailbox password');

DreamHost

define('SMTP_HOST', 'smtp.dreamhost.com');
define('SMTP_PORT', '587');
define('SMTP_SECURE', 'STARTTLS');
define('SMTP_USER', '[email protected]');
define('SMTP_PASS', 'your mailbox password');

InMotion Hosting

define('SMTP_HOST', 'secure123.inmotionhosting.com');  // your server number
define('SMTP_PORT', '465');
define('SMTP_SECURE', 'SMTPS');            // or port 587 with STARTTLS
define('SMTP_USER', '[email protected]');
define('SMTP_PASS', 'your mailbox password');

HostGator

define('SMTP_HOST', 'gator1234.hostgator.com');  // your server name
define('SMTP_PORT', '465');
define('SMTP_SECURE', 'SMTPS');
define('SMTP_USER', '[email protected]');
define('SMTP_PASS', 'your mailbox password');

Hostinger

define('SMTP_HOST', 'smtp.hostinger.com');
define('SMTP_PORT', '465');
define('SMTP_SECURE', 'SMTPS');            // or port 587 with STARTTLS
define('SMTP_USER', '[email protected]');
define('SMTP_PASS', 'your mailbox password');

Email services

If your website's email isn't reliable, you can send through a separate email service instead. You'll need to verify your sender address or domain with the service first, and set EMAIL_FROM to that verified address, because the login for these services isn't an email address.

Gmail and Google Workspace

define('SMTP_HOST', 'smtp.gmail.com');
define('SMTP_PORT', '465');
define('SMTP_SECURE', 'SMTPS');            // or port 587 with STARTTLS
define('SMTP_USER', '[email protected]');
define('SMTP_PASS', 'your 16-character app password');

Microsoft 365 and Outlook

define('SMTP_HOST', 'smtp.office365.com');
define('SMTP_PORT', '587');
define('SMTP_SECURE', 'STARTTLS');
define('SMTP_USER', '[email protected]');
define('SMTP_PASS', 'your password');
Not recommended for new forms. Microsoft is switching off password logins for SMTP (called "SMTP AUTH basic authentication"): by default, existing Microsoft 365 organisations lose it at the end of December 2026, and Microsoft plans to remove it completely later. An administrator can turn it back on for now, but it won't last. Use your web host's mailbox or an email service such as Brevo or SendGrid instead.

SendGrid

define('SMTP_HOST', 'smtp.sendgrid.net');
define('SMTP_PORT', '587');
define('SMTP_SECURE', 'STARTTLS');
define('SMTP_USER', 'apikey');             // literally the word apikey
define('SMTP_PASS', 'your SendGrid API key');
define('EMAIL_FROM', '[email protected]');  // a verified sender

Mailjet

define('SMTP_HOST', 'in-v3.mailjet.com');
define('SMTP_PORT', '587');
define('SMTP_SECURE', 'STARTTLS');
define('SMTP_USER', 'your Mailjet API key');
define('SMTP_PASS', 'your Mailjet secret key');
define('EMAIL_FROM', '[email protected]');  // a verified sender

Brevo (formerly Sendinblue)

define('SMTP_HOST', 'smtp-relay.brevo.com');
define('SMTP_PORT', '587');
define('SMTP_SECURE', 'STARTTLS');
define('SMTP_USER', 'your Brevo SMTP login');
define('SMTP_PASS', 'your Brevo SMTP key');
define('EMAIL_FROM', '[email protected]');  // a verified sender

Found a setting that's changed, or want a host added? Let me know.