Simple PHP email function

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.

Send email using PHP
Click image to view Larger
Here am explaining you how to submit a form to an email id using PHP function. In this example I will make a feedback form to your website.

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.

Download FileDemo

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>