Remove “via” information from emails – WordPress

If you’ve ever sent an email from your WordPress website and noticed the extra “via” information (for example, “sent via yourserver.com”) in the sender details, you’re not alone. This often happens when your website uses the default PHP mail function instead of a verified SMTP connection.

In this article, you’ll learn how to remove the “via” information from WordPress emails by setting up your own SMTP server.

Why Use Your Own SMTP Server?

By default, WordPress uses PHP mail to send emails, which may cause authentication issues or display “via” information. Using an SMTP server ensures:

  • Better email deliverability
  • Professional-looking “From” details
  • Compatibility with your domain’s SPF and DKIM records
  • Elimination of the “via” tag in outgoing emails

Before proceeding, make sure you know your SMTP server details. Most web hosting plans already include an SMTP server or PHPMailer setup. If you’re unsure, contact your web hosting provider (for example, Bluehost, SiteGround, or Hostinger) for the correct SMTP information.

Step 1: Add Your SMTP Credentials

Open your wp-config.php file (found in your website’s root directory) using a text editor, then paste the following code just below the database constants:

define('SMTP_USER',   'your email');          // Username for SMTP authentication
define('SMTP_PASS',   'your password');       // Password for SMTP authentication
define('SMTP_HOST',   'your host');           // Hostname of the mail server (usually your domain)
define('SMTP_FROM',   'from email address');  // SMTP From email address
define('SMTP_NAME',   'from name');           // SMTP From name
define('SMTP_PORT',   '465');                 // SMTP port (25, 465, or 587)
define('SMTP_SECURE', 'ssl');                 // Encryption type: ssl or tls
define('SMTP_AUTH',   true);                  // Enable SMTP authentication (true/false)

Tip: For better security, define your credentials in wp-config.php rather than functions.php.

Step 2: Configure WordPress to Use SMTP

Next, open your functions.php file (located in your active theme directory) and paste this code:

add_action('phpmailer_init', 'custom_send_smtp_email');
function custom_send_smtp_email($mailer) {
    $mailer->isSMTP();
    $mailer->Host       = SMTP_HOST;
    $mailer->SMTPAuth   = SMTP_AUTH;
    $mailer->Port       = SMTP_PORT;
    $mailer->Username   = SMTP_USER;
    $mailer->Password   = SMTP_PASS;
    $mailer->SMTPSecure = SMTP_SECURE;
    $mailer->From       = SMTP_FROM;
    $mailer->FromName   = SMTP_NAME;
}

This tells WordPress to use your SMTP configuration whenever the wp_mail() function is called.

Step 3: Test Your Email

Once everything is set up, send a test email from your website (for example, using a contact form). You should now see your email sent without the “via” information in the sender details.

If you still notice “via” appearing, double-check your SMTP settings or confirm that your domain’s SPF and DKIM records are properly configured.

Conclusion

That’s it! You’ve successfully removed the “via” information from your WordPress emails using your own SMTP setup.

This approach improves both email deliverability and brand professionalism — and it only takes a few minutes to configure.

If you found this article helpful, please share it or leave a comment below.
Happy coding!

How to send email with your own domain using Gmail

Many business owners want to maintain a professional image by sending emails from their custom domain (like [email protected]). Fortunately, Gmail allows you to combine the professionalism of a branded email with its familiar interface and powerful features. In this guide, you will learn step-by-step how to set up Gmail to send emails from your own domain, including screenshots and SMTP configuration tips.

Why Use Gmail with Your Own Domain?

Using Gmail with a custom domain offers several advantages. First, emails appear from your domain, which helps build trust with clients. Additionally, you can continue using Gmail’s intuitive interface, including labels and filters. Moreover, managing multiple accounts becomes easier because everything is centralized in one inbox. Finally, Gmail provides built-in security features like spam filtering and two-factor authentication, keeping your email safe and reliable.

Step 1: Access Gmail Settings

To begin sending emails from your custom domain, you need to access Gmail’s settings. Start by opening Gmail and clicking the gear icon in the top-right corner. Then, select See all settings. After that, go to the Accounts and Imports tab to proceed.

  1. Open Gmail and click the gear icon in the top-right corner
  2. Select See all settings.
  3. Go to the Accounts and Imports tab.

Step 2: Add Your Custom Email Address

  1. Under the “Send mail as” section, click Add another email address.
  2. A popup will appear. Enter your name and custom email address.
  3. Make sure “Treat as an alias” is checked and click Next Step.

Step 3: Configure SMTP Server

  1. Enter your SMTP server, username, and password.
    • Usually, the username is your full email address.
    • SMTP details are provided by your hosting provider; check Google Workspace SMTP settings if needed.
  2. Click Add Account.

Step 4: Verify Your Email Address

  1. Gmail will send a verification email to your custom email.
  2. Open the email and click the verification link. Once verified, your Gmail account can now send emails using your own domain.

Benefits of Using Gmail with Your Own Domain

  • Professional branding: Emails come from your domain, improving credibility.
  • Gmail interface: Continue using Gmail’s intuitive interface, labels, and filters.
  • Centralized inbox: Manage multiple accounts in one place.

Additional Tips

  • Checkout how out other article to improve email deliverability
  • If you’re using WordPress, consider linking your custom email to WP Mail SMTP for reliable delivery.
  • Ensure your domain has proper SPF, DKIM, and DMARC records set up to prevent emails from landing in spam.

If you find this guide helpful, please don’t hesitate to click the like button below or share it with friends!