So why do we need to set up an external mail server in Joomla? Well, there are circumstances under which a legitimate external mail server can come to your rescue. This tutorial will help you to set up Sendgrid as your Joomla SMTP mail server.
Let us suppose that you’re allowing registrations on your Joomla website which requires email validation or you could be sending Newsletters regularly to your blog readers. All these entail sending mails from your local mail server.
However, if for some reason the server IP of your hosting account has been marked for sending out spam emails by erring customers then the mails that you send from your website will also be marked as spam. In this case your mails will either be blocked or land on the wrong folder, which is, of course, the spam folder. All these for no fault of yours. You’re just a victim of someone else’s antics and it can happen to anyone especially on shared hosting.
The proper way to deal with this issue is to approach your hosting provider. They should be able to set up certain mechanisms to prevent any of its customers from sending out spams. Once they get their act together, they can request their blacklisted IPs to be removed from sites such as Spamhaus.
There is more to it but that is beyond the scope of this article. Anyway, the problem with this approach is that it is time consuming and the results cannot be guaranteed. In fact, you’re better off setting up your website to send emails from an external mail server until the issue gets resolved.
So this is where Sendgrid comes in. There are other mail servers as well but I’ve been using their services for a long time and I know for a fact that their performance is simply outstanding. With Sendgrid you can monitor the number of emails that you send from your website, times they were opened, times they were marked as spam by the recipients etc. which is really cool.
Meanwhile, Sendgrid is a cloud-based email delivery and management service and their products are being utilized by many renowned companies all over the globe. Yes, they do offer a free trial worth $10 for one month and then it defaults to free plan i-e, if you choose not to renew. Moreover, you do not need a credit card to sign up for the trial product.
The free plan is capable of sending upto 12k emails per month, which is probably ample enough for smaller websites. However, you do have the option to scale up seamlessly as your demand grows.
Setting up Sendgrid as your Joomla SMTP mail server
- Sign up for Sendgrid. If you’re aiming for the free plan, click on ‘Try for free’.
As mentioned before it defaults to the free plan after one month if you do not renew. Please note that when you sign up, you’re application will probably be reviewed manually. So it will take some time before you receive the confirmation email from them which will then allow you to send emails from your account and domain.
- Once you ‘pass provisioning’ from Sendgrid, login to your Joomla back-end.
- Navigate to Global Configuration > Server.
- Under Mail Settings, populate the fields as explained below:
- From Email – Choose an email with administrator rights (you’re going to send the mails from your website from this email).
- Mailer – SMTP
- SMTP Host – smtp.sendgrid.net
- SMTP Port – 587
- SMTP Security – STARTTLS
- SMTP Authentication – Set it to yes
- SMTP Username – Enter your Sendgrid username.
- SMTP Password – Enter your Sendgrid login password.
Once you’re done, you can try sending a test email using the link below the Mail Settings and that is all there is to it.
Regarding the SMTP Security (mail encryption options), for some reason SSL/TLS did not work for me even after changing the port to 465 as recommended by Sendgrid and yes that port was already open from my end. Interestingly, it worked on some older versions of Joomla like 3.2.
Further, if you’re not comfortable using your Sendgrid username and password for the corresponding SMTP fields, you can create an API key after logging in to your Sendgrid account. Once you have the key you can simply use it for the SMTP password and ‘apikey’ as the username.
So that is how you set up Sendgrid as your Joomla SMTP mail server. If you have successfully followed the steps mentioned above, you do not have to worry about mail deliveries from your website anymore.