PHP have a built in function called mail. By using PHP mail function we can send email from our server through HTML form to any email id. The main usage of PHP email function is you can send email to your user dynamically. Along with this you can get feedback from visitors and its act as a direct communication with user.
After completing the HTML form you have to make ready of our input fields of form to process in PHP. First give name for all the input fields like name, email, mobile no and message. Make sure that your form submitting method should be in post method.
Now copy and paste the following code to the PHP file or download the example file below.
Once you submit the form the PHP will get the values from all input boxes and send it to mentioned email ID. Remember that you have to change the email id in the example file.
This is a simple way of email in PHP. We can also make attachments, image and embedded video in PHP mail function.