Wednesday, January 13, 2021

Create a PHP Send Email Contact Form - using PHPMailer - Step by Step



Description


Hello everyone! In this video, you are going to learn step by step how to create a contact form to send an email to a specific email address using PHPMailer.


There is a web page on a website that allows users to make contact with the site owner called the contact page. The page has fields for filling in email, name, message and etc. On most websites, email and mail addresses are also included as more info. however, the contact form provides major space, convenient way for users to communicate with the site owner for this purposes.


Lets see how to do it according to this tutorial. First yo need to download the PHP mailer from github. Then extract that file and copy the file to the folder that you created in htdocs. Watch the video for more details. Then you have to do a important step In your gmail account (the gmail account that you are going to use to send emails) go to your account settings and in the security tab you can see "less secure app access ". In default it is turned off and you need to turn it on. It's important. then start the apache server on your localhost. Then start to code. In the index.php file you need to create the contact form . The code the sendEmail.php file (follow the video). I think it is not hard to follow. Hope this video will be helpful to create a contact form to send emails using your gmail account.



All the source codes and source files and available to download from here. Use the download button or copy and paste the code from the text editors. My opinion is first try to do it by following the video line by line. It will help you t o understand all of it. After that, if your code is wrong or not working use the given source codes to compare with your code. It will help you to understand all of your mistakes.


Source Codes For Create a PHP Send Email Contact Form


index.php



sendEmail.php



Download Source Files

We only allow you to publish relevant and respectful comments. Vulgar, hateful, or spam comments will be removed.

  1. Hello, very good tutorial! I wanted to know if instead of replacing a css style I could replace one class with another? And what would the structure be like?

    ReplyDelete
  2. hello thank you for evey think
    but code does not runing into my laptop

    ReplyDelete
  3. that's coz you haven't turn on

    ReplyDelete

Whatsapp Button works on Mobile Device only