By default, WordPress uses PHP’s built-in mail() function to send transactional emails, including contact form submissions, password reset requests, new user account notifications, and WooCommerce order receipts. However, the default PHP mailer lacks cryptographic authentication (such as SMTP authentication, SPF, and DKIM signatures). As a result, major email providers like Google Gmail, Microsoft Outlook, and Yahoo often flag these unauthenticated emails as spam or reject them completely.

Configuring SMTP (Simple Mail Transfer Protocol) in WordPress ensures that every email generated by your website is routed through an authenticated mail server using secure SSL/TLS encryption. This guarantees reliable email delivery directly into your recipients’ inboxes.

In this comprehensive, step-by-step tutorial, you will learn how to create your business email account in DirectAdmin, install and configure the official WP Mail SMTP plugin (by WPForms), connect your hosting SMTP server, and send a live test email to verify delivery.


Prerequisites


Step-by-Step Guide: How to Set Up SMTP in WordPress

Step 1: Create an Email Account in DirectAdmin

Before configuring WordPress, you need an active email mailbox on your hosting server to send authenticated emails:

  1. Log in to your Aveshost Client Area (my.aveshost.com).
  2. Navigate to Services > select your active web hosting service > click Log in to DirectAdmin.
  3. In DirectAdmin, navigate to E-Mail Manager > click on E-Mail Accounts.
  4. Click the Create Account button in the top right corner.
  5. Fill in the mailbox details:
    • User Name: Enter your desired prefix (e.g. info, notifications, or contact).
    • Password: Generate a strong, secure password (save this password safely as you will need it in WordPress).
    • E-Mail Quota: Set your desired disk quota (or leave as default).
  6. Click Create Account.
  7. Note Your SMTP Connection Details:
    • SMTP Server / Host: mail.domain.com
    • SMTP Port: 465 (SSL) or 587 (TLS)
    • SMTP Username: Your full email address (e.g. [email protected])
    • SMTP Password: The mailbox password you just created

Step 2: Install and Activate WP Mail SMTP in WordPress

  1. Log in to your WordPress Admin Dashboard (e.g. https://domain.com/wp-admin).
  2. In the left sidebar, navigate to Plugins > Add New Plugin.
  3. In the search box in the top right corner, search for WP Mail SMTP (developed by WPForms).
  4. Click Install Now, and once the installation finishes, click Activate.

Step 3: Access WP Mail SMTP Settings

  1. In your WordPress dashboard menu, navigate to WP Mail SMTP > Settings.
  2. Stay on the General tab.

Step 4: Configure Primary Sender Information

In the Primary Mailer section, set your sender details:

Setting Description Recommended Value
From Email The email address that will appear as the sender of all WordPress notifications. [email protected] (your DirectAdmin mailbox)
Force From Email Forces all plugins (WPForms, Contact Form 7, WooCommerce, Elementor) to use this verified From Email. Checked (Recommended)
From Name The human-readable sender name displayed in the recipient's inbox. Your Website Name (e.g. Aveshost Support)
Force From Name Ensures a uniform sender name across all site emails. Checked (Optional)

Step 5: Select "Other SMTP" Mailer

  1. Scroll down to the Mailer section.
  2. Select Other SMTP to route emails through your DirectAdmin mail server.

Step 6: Enter Your DirectAdmin SMTP Credentials

Configure the connection parameters using your DirectAdmin email details:

Configuration Field Secure SSL (Recommended) TLS / STARTTLS
SMTP Host mail.domain.com mail.domain.com
Encryption SSL TLS
SMTP Port 465 587
Auto TLS ON ON
Authentication ON (Enabled) ON (Enabled)
SMTP Username Your full email address (e.g. [email protected]) Your full email address (e.g. [email protected])
SMTP Password The password for your DirectAdmin email account The password for your DirectAdmin email account
  1. Click the Save Settings button at the bottom of the page.

Step 7: Send a Live Test Email to Verify Delivery

  1. Navigate to WP Mail SMTP > Tools > Email Test.
  2. In the Send To field, enter your personal email address (e.g. your Gmail or Outlook address).
  3. Ensure HTML is toggled to ON.
  4. Click Send Email.
  5. You should see a green success message: “Success! An email was sent to your email address with test details.”
  6. Check your recipient inbox to confirm delivery and verify that the sender displays as [email protected] with valid authentication.

Alternative Option: Using FluentSMTP

If you prefer an alternative 100% free, lightweight SMTP solution with built-in unlimited email logging, you can also use FluentSMTP:

  1. In WP Admin, navigate to Plugins > Add New Plugin > search for FluentSMTP > install and activate.
  2. Navigate to Settings > FluentSMTP.
  3. Click Add Connection > select Other SMTP.
  4. Enter your From Email ([email protected]), From Name, SMTP Host (mail.domain.com), Port (465 with SSL or 587 with TLS), and your DirectAdmin credentials.
  5. Click Save Connection and perform a test email from the Tools tab.

Advanced Security: Storing SMTP Credentials in wp-config.php

For enhanced security and to prevent storing your SMTP password in plain text inside the WordPress database, you can define your credentials directly in your wp-config.php file:

// Secure WP Mail SMTP Constants in wp-config.php
define( 'WPMS_ON', true );
define( 'WPMS_MAIL_FROM', '[email protected]' );
define( 'WPMS_MAIL_FROM_NAME', 'Aveshost Support' );
define( 'WPMS_MAILER', 'smtp' );
define( 'WPMS_SET_RETURN_PATH', 'true' );
define( 'WPMS_SMTP_HOST', 'mail.domain.com' );
define( 'WPMS_SMTP_PORT', 465 );
define( 'WPMS_SSL', 'ssl' );
define( 'WPMS_SMTP_AUTH', true );
define( 'WPMS_SMTP_USER', '[email protected]' );
define( 'WPMS_SMTP_PASS', 'YourSecurePasswordHere' );

Frequently Asked Questions & Troubleshooting

Q: Why does the test email return "SMTP Error: Could not authenticate"?
A: This error occurs when the SMTP Username does not match your full email address (e.g. entering just info instead of [email protected]), or if the password was entered incorrectly. Verify your credentials in DirectAdmin under E-Mail Accounts.

Q: Why does the connection time out on port 465 or 587?
A: Ensure that your SMTP Host is set to mail.domain.com (or your server’s hostname) and that your encryption type matches the port: use Port 465 with SSL or Port 587 with TLS.

Q: Why are contact form submissions still landing in the recipient's Spam folder?
A: Make sure your domain has active SPF, DKIM, and DMARC DNS records. In DirectAdmin, go to E-Mail Manager > E-Mail Accounts > ensure DKIM is enabled (see our guide on How to Enable DKIM in DirectAdmin).

Q: Can I use Gmail SMTP (OAuth2) with WP Mail SMTP?
A: Yes. WP Mail SMTP supports Google/Gmail mailer using Google Cloud Console API credentials (OAuth 2.0). However, for professional business websites, using your domain's native hosting email ([email protected]) via Other SMTP provides higher sending limits and stronger brand authority.


Need Further Assistance?

If you encounter any issues configuring SMTP in WordPress, setting up contact form notifications, or verifying DNS authentication records, our technical support team is available 24/7. Feel free to submit a support ticket through your client area for expert assistance.

?האם התשובה שקיבלתם הייתה מועילה 0 משתמשים שמצאו מאמר זה מועיל (0 הצבעות)