What is PHP mail and how does it differ to SMTP?

PHP Mail, also known as PHP Mailer is a piece of software that runs on most web servers that enable the web servers (your websites) to send an email out, without you needing to set up a dedicated email address for it to use or make any configurations.

An example of a PHP mail address (which you may recognise) is: wordress@cpanelUsername.serverhostname.co.uk

SMTP, however, requires an account to be set up and the website configured to use that created account to send via the SMTP protocol, rather than PHP. Because the transport of the message requires authentication, the message itself is generally considered safer than one sent via PHP.

An example of an SMTP address is: no-reply@yourdomain.com

 What are the benefits to using PHP to send Mail?

Ease of use. This is the only real reason to be using PHP mail.

Our platforms (like most providers) come preconfigured to use PHP Mail on your website, this allows your site to send out update emails, contact forms, and any other messages without any kind of configuration on your part to get this working.

 What are the benefits to using SMTP to send Mail?

Even though PHP Mail is the default setup on most CMS (WordPress, Joomla, etc) there are actually more issues with using this as your mail transport, than using SMTP.

·         Speed – Emails sent via SMTP are generally sent quicker than one sent via PHP.

·         Security – Emails sent have to be verified with a username and password.

·         Deliverability – As the emails are authenticated, this makes receiving email servers rate the message as less spammy / more authentic, compared to a PHP mail address.

·         Aesthetics – Customers receive an email from orders@yourdomain.com, rather than wordpress@cpanelUsername.serverhostname.co.uk for example.

Conclusion

While PHP mail is a great tool and is easy to use, it should not be used for production environments and certainly not where email deliverability is important (for example, order emails.) as PHP mail has a habit of ending up in Junk Spam Folders due to the unauthenticated nature of the message.

If you wish to convert your Wordpress site to use SMTP, please take a look at this article:

Using SMTP to send emails from WordPress

 


How did we do?


Powered by HelpDocs (opens in a new tab)
© Krystal Hosting Ltd 2002–