Configuring SMTP
To use an SMTP server to send the emails you will need to enter your SMTP server connection information in process.php, search for the term $config['smtp']
. You will see an array, fill out the corresponding empty quotes on the right hand side of the array with your connection details. For example, to send mail via Gmail it may look something like this.
1 2 3 4 5 6 7 | $config['smtp'] = array( 'host' => 'smtp.gmail.com', 'port' => 465, 'username' => 'your-username@gmail.com', 'password' => 'your-password', 'encryption' => 'ssl' ); |
$config['smtp'] = array( 'host' => 'smtp.gmail.com', 'port' => 465, 'username' => 'your-username@gmail.com', 'password' => 'your-password', 'encryption' => 'ssl' );
Reliable SMTP servers
There are some premium and free SMTP services available which are probably more reliable than your own mail server and have a higher delivery success.
SparkPost
Free (up to 100,000 emails per month)
SparkPost have a free SMTP service that allow you to send 100,000 emails per month for free (10,000 per day). The service also has a Dashboard where you can track each sent email. Visit https://www.sparkpost.com to sign up.
Mailjet
Free (up to 6,000 emails per month)
Mailjet have a free SMTP service that allow you to send 6,000 emails per month for free (200 per day). The service also has a Dashboard where you can track each sent email. Visit https://www.mailjet.com to sign up and see this page for how to get the SMTP settings.
Gmail
Free
You can use the free Gmail SMTP service to send emails, example settings are at the top of this page.
Troubleshooting the SMTP connection
If you have configured the SMTP connection and you are still not receiving emails, or you are now getting an error when submitting the form, open the file quform/smtp-check.php (or download it from here if the file is not there) and follow the instructions at the top of the file, this file will give a detailed debugging output to help you identify the cause of the problem.
Using SMTP on a local server (WAMP, XAMPP etc.)
If you are developing your site locally with a web server package such as XAMPP, you will need to enable OpenSSL in PHP to connect to SMTP servers which use TLS or SSL. See this page to find out how.