How to Send Mail Using SMTP in PHP

14 Apr, 2019

SMTP is used to send and receive the email, so in this post, we will learn How to Send Mail Using SMTP in PHP because sometimes server needs to configure the SMTP to send the mail, but in another case, we can use simple PHP mail function to send the mail. But if you want to configure Gmail SMTP to send the mail we need to require some files that will definitely help.

So we have taken a simple 5 fields form and included PHPMailer files then we have sent the mail.

How to Send Mail Using SMTP in PHP

Step 1: First I have taken contact form field, there are 5 fields where you can add or remove according to you!

Step 2: Now need to include PHPMailer files and folder to and use Gmail account username, password to configure and the send the mail.

Note: Please don’t forget to Include PHPMailer files and folder and correct Gmail username, Password


Please enter your comment!
Please enter your name here