PHP mail limitations

When it comes to sending emails from a Joomla website, the PHP mail function is the default option. However, this method has some limitations and can lead to unexpected results. One of the main issues with using the mail function is that it does not provide feedback on errors, making it difficult to troubleshoot any issues that may arise. Instead of reporting such errors, the mail function always returns a successful completion result. This is why you may receive test emails, but when trying to test an extension, you get no emails and no errors whatsoever.

Moreover, the PHP mail function configuration is controlled by your host. On some servers, it may change unexpectedly and stop working altogether.

A better alternative

A more stable and reliable option for sending emails from a Joomla website is to connect to your server using the Simple Mail Transfer Protocol (SMTP). By using SMTP, you ensure that your emails are sent more reliably and that any errors that occur are reported back to you. This makes it much easier to troubleshoot any issues that may arise, while still testing extensions.

By using SMTP, you have better deliverability and security, as emails sent can be authenticated and encrypted, thus decreasing their chances of ending up in spam.

How to connect to SMTP in Joomla

Connecting to SMTP in Joomla is very easy and you do not require any additional extensions. You can do it directly in your site's Global Configuration, by going to System > Global Configuration. In the Server tab, there's a Mail group of fields, where you can write the settings provided by your host. These options usually look something like this:

These options may vary greatly depending on your server's settings. However, in general, the SMTP host may be localhost or a URL similar to your website. The SMTP Port can be 25 for non-encrypted connections and 465 or 587 for encrypted connections, and the SMTP Security gives you the option to selected between encryption and non-encryption. SSL/TLS means encrypted.

The rest is just your email address and your password.

Which email address to use?

It's best to use an email address that belongs to your actual domain name. An external email address like Gmail or Yahoo can be used, but it's generally considered best to send emails using your own domain. If you want, you can connect to a no-reply account (like in the example above) to send emails, and specify your actual email address in the Reply To Email.

How to change this in Mavrosxristoforos.com extensions?

After setting up SMTP in your Global configuration, you don't need to take any further steps. All of our extensions use these settings to send emails, automatically! Woohoo!