"Test mail could not be sent." or "Could not instantiate mail function" in Joomla Mail Settings sending a test mail.
If you are getting the following error "Test mail could not be sent." or "Could not instantiate mail function." trying to send a test email from the Joomla Mail Settings, this is because Azure Web Apps don't support smtp or email service by default. Customers need to configure a third party smtp service and add it to Joomla settings.
Please review the following reference to know more about this service. https://azure.microsoft.com/en-us/documentation/articles/store-sendgrid-mobile-services-send-email-scripts
How to create a SendGrid account
Create a SendGrid is easy, you just need to go to Azure portal (http://portal.azure.com) and follow these steps:
- Clic on "New" button.
- Select Marketplace and type for "SendGrid".
- Choose the one that is related to "SendGrid Email Delivery".
- And then clic on "Create" button.
- Fill all required files on the form. (Select a pricing tier, contact information, review also the legal terms)
After you set up the SendGrid account, you will see your configurations (username, smtp server, etc). You can use this information to complete Joomla Mail Settings.
How to add SendGrid configuration to Joomla Mail Settings
Inside the "Global Configuration", select "Server" tab and select the following settings:
1.- Change the Mailer option to "SMTP"
2.- Type a "From email" sender.
3.- Choose the SMTP Security.
- You can set SMTP Security to none and use port 25. (SendGrid recommends customers to use port 587 to avoid any rate limiting that your server host may apply.)
- Or use SMTP Security to SSL and use port 465.
You can find more documentation about SendGrid SMTP Ports in this reference: https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html
If everything is working fine, you are going to receive a test email like this:
Check the following references for more information about PHP & SendGrid: