Why use SMTP authentication for emails instead of PHP Mail

This is a question very often asked by webmasters and developers – this post help you understand, which method you should be using got sending emails and their impacts.

PHP Mail() Introduction

PHP mail() by far is the easiest way to send emails BUT this comes with alot of security issues & weak controls – when you allow your website to send out emails through PHP mail function you don’t authenticate your email with password i.e. email is sent from blanket account tagging – needless to say, ISPs know this behavior and they can punish you by sending your emails to Junk instead of receiver’s inbox.

SMTP Authentication Introduction

SMTP authentication is the method where you authenticate your email credentials before it is sent out to the receiver. This may take an additional 5 minutes of your time compared to PHP Mail() to setup but you get the benefit of sending real email that tells ISPs that the email they are receiving is coming from a real email account i.e. better chances of you delivering email to user Inbox and not Junk!

PHP Mail() vs SMTP Authentication

We outlined the primary difference above between the two methods, however the below list helps you understand further details:

  • When you send emails through SMTP, receiver ISP consider your email secure and improves email delivery
  • PHP mails reduce the reputation of your domain/IP and it impacts alot factors negatively including suspension/blacklisting of IP addresses
  • The most wide attack on any wordpress site are the scripts that generate tons of spam email through PHP mail, forcing SMTP means that you reduce your chances of getting hurt
  • Better control when you use SMTP for email delivery, you can be sure that any email being sent through your account is password authenticated


With years of experience in managing thousands of sites, we say that you should always use SMTP authentication for any emails you send out. SMTP authentication method is secure, reliable and more than anything it improves your email delivery!

Redirect http to https with htaccess

Chrome and firefox have started to show warning to visitors when the SSL is not installed on the website. Additionally, Google & all majore search engines also prefer sites that use https (SSL) i.e. giving better chances of ranking well in search results (SEO benefits).

There are many benefits of using SSL / https – now le’s talk about how you can get SSL for your website. You can purchase a standard SSL in the market that will roughly cost around $10/year.

Good news for Easyhost Web Hosting customers – all our web hosting packages include Free SSL and Domain, instant saving! Easyhost automatically install SSL on all its web hosting plans within 24 hours of activation of service – FREE SSL!

How to redirect all traffic from http to https in 5 minutes

When your SSL is installed, the best approach is to keep a unified https link for visitors to see your site – inorder to do this, add below given code block to .htaccess file:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [L,R=301]

(change yourdomain.com with your actual domain name)

How to add code to .htaccess file

Follow the steps given below to redirect all your traffic to https version:

  • Login to cPanel
  • Navigate to Files > File Manager
  • From top right section, opt to “Show Hidden Files (dotfiles)
  • Find .htaccess file and select to edit (if the file doesn’t exist already, create one)
  • Add above given to .htaccess file and click “Save Changes”
  • Close the .htaccess and try your website with http version and it should direct you to https version! All done!!!

Why choose .PK Domain for your Website

There are many reasons why you should go for .PK domain extension for your next website project. One of the biggest reason is that .PK domains gives you better branding and visibility (as it refers that your business is operating in Pakistan) and also gets you better ranked in Search Engines!

Here are some other cool reasons why you should go for .PK domains:

  • Get unique names! .com is occupied heavily and there are more chances that you can find unique brand name easily on .pk extension
  • Local identity: Your business / brand conveys clearly to visitors that you operate in Pakistan and therefore has better chances of growth
  • Matching names: If you already own a .com domain and have not reserved .pk extension, do it now, before anyone else takes your local identity and beats you brand!

Search .PK Domain now and book your name right away!