Lets Know Projects

Simplify communication with our Contact Form with Mail Function solution. Effortlessly collect inquiries, feedback, or customer details and deliver them directly to your email. Designed for seamless integration and user-friendly interaction, this feature enhances engagement, ensures timely responses, and helps businesses maintain effective communication with their audience.

CONTACT FORM WITH MAIL FUNCTION

Enhance your website’s interaction with visitors through our Contact Form with Mail Function, designed to streamline customer inquiries, lead generation, and message management. This digital contact form solution allows users to easily submit queries, feedback, or requests, while automatically sending responses to the designated email addresses. With features like customizable form fields, automated email notifications, and secure data handling, our system ensures a seamless and efficient communication experience. Upgrade to a smart contact form with mail function and improve your website’s connectivity today.

Project Name                     Contact form with mail function and Storing data in the database
Language Used                  PHP5.6, PHP7.x
Database                             MySQL 5.x
User Interface Design     HTML, AJAX,JQUERY,JAVASCRIPT
Web Browser                      Mozilla, Google Chrome, IE8, OPERA
Software                              XAMPP / Wamp / Mamp/ Lamp (anyone)
Last Updated                     02 August 2024

Contact form with mail function and Storing in the database project has two modules:

  • User Module
  • admin Module

User Module

  1. CREATE TABLE `tblcontactdata` (
  2. `id` int(11) NOT NULL,
  3. `FullName` varchar(200) DEFAULT NULL,
  4. `PhoneNumber` char(12) DEFAULT NULL,
  5. `EmailId` varchar(200) DEFAULT NULL,
  6. `Subject` varchar(255) DEFAULT NULL,
  7. `Message` mediumtext,
  8. `UserIp` varbinary(16) DEFAULT NULL,
  9. `PostingDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  10. `Is_Read` int(1) DEFAULT NULL
  11. ENGINE=InnoDB DEFAULT CHARSET=latin1;
  12. ALTER TABLE `tblcontactdata
  13. MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;

Now create an HTML for user inputs.index.php

<form name=”ContactForm” method=”post”>
<h4>your name</h4>
<input type=”text” name=”name” class=”user” placeholder=”Johne” autocomplete=”off” required>
<h4>your phone number</h4>
<input type=”text” name=”phonenumber” class=”phone” placeholder=”0900.234.145678″ maxlength=”10″
required autocomplete=”off”>
<h4>your email address</h4>
<input type=”email” name=”emailaddres” class=”email” placeholder=”Example@mail.com” required
autocomplete=”off”>
<h4>your subject</h4>
<input type=”text” name=”subject” class=”email” placeholder=”Subject” autocomplete=”off”>
<h4>your message</h4>
<textarea class=”mess” name=”message” placeholder=”Message” required></textarea>
<input type=”submit” value=”send your message” name=”submit”>
</form>

MySQL database connection

<?php
// DB credentials.
define(‘DB_HOST’,’localhost’);
define(‘DB_USER’,’root’);
define(‘DB_PASS’,”);
define(‘DB_NAME’,’contactdb’);
// Establish database connection.
try
{
$dbh = new PDO(“mysql:host=”.DB_HOST.”;dbname=”.DB_NAME,DB_USER,
DB_PASS,array(PDO::MYSQL_ATTR_INIT_COMMAND => “SET NAMES ‘utf8′”));
}
catch (PDOException $e)
{
exit(“Error: ” . $e->getMessage());
}
?>

Insert Data into Database

include(‘config.php’);
if(isset($_POST[‘submit’]))
{
// getting Post values
$name=$_POST[‘name’];
$phoneno=$_POST[‘phonenumber’];
$email=$_POST[’emailaddres’];
$subject=$_POST[‘subject’];
$message=$_POST[‘message’];
$uip = $_SERVER [‘REMOTE_ADDR’];
$isread=0;
// Insert quaery
$sql=”INSERT INTO tblcontactdata(FullName,PhoneNumber,EmailId,Subject,Message,UserIp,Is_Read)
VALUES(:fname,:phone,:email,:subject,:message,:uip,:isread)”;
$query = $dbh->prepare($sql);
// Bind parameters
$query->bindParam(‘:fname’,$name,PDO::PARAM_STR);
$query->bindParam(‘:phone’,$phoneno,PDO::PARAM_STR);
$query->bindParam(‘:email’,$email,PDO::PARAM_STR);
$query->bindParam(‘:subject’,$subject,PDO::PARAM_STR);
$query->bindParam(‘:message’,$message,PDO::PARAM_STR);
$query->bindParam(‘:uip’,$uip,PDO::PARAM_STR);
$query->bindParam(‘:isread’,$isread,PDO::PARAM_STR);
$query->execute();
$lastInsertId = $dbh->lastInsertId();
if($lastInsertId)
{
//mail function for sending mail
$to=$email;
$headers .= “MIME-Version: 1.0″.” “;
$headers .= ‘Content-type: text/html; charset=iso-8859-1’.” “;
$headers .= ‘From:Waterflame Institute Contact Form Demo<chotu.rocking007@gmail.com>’.” “;
$ms.=”<html></body><div>
<div><b>Name:</b> $name,</div>
<div><b>Phone Number:</b> $phoneno,</div>
<div><b>Email Id:</b> $email,</div>”;
$ms.=”<div style=’padding-top:8px;’><b>Message : </b>$message</div><div></div></body></html>”;
mail($to,$subject,$ms,$headers);
echo “<script>alert(‘Your info submitted successfully.’);</script>”;
}
else
{
echo “<script>alert(‘Something went wrong. Please try again’);</script>”;
}
}

Admin Module

Admin Panel feature

  • Secure login with password hashing
  • Admin Dashboard
  • Manage Contact’s
  • Report’s
  • Update Remark on the particular contact
  • Notification feature(Admin can get the notification on every contact)
  • Admin Can update email id where he/she want to receive email
  • Change Password
  • Logout.

In this project admin and user will a get copy of contact form on email. Email Function will  not work on localhost. 

Some of the Project Screens

 

CONTACT FORM WITH MAIL FUNCTION
CONTACT FORM WITH MAIL FUNCTION
How to run the  Contactform Mini Project 
  1. Download zip the file
  2. Extract the file and copy the contactform folder
  3. Paste inside root directory(for xampp xamp/htdocs, for wamp wamp/www,for lamp var/www/HTML)
  4. Open PHPMyAdmin (http://localhost/phpmyadmin)
  5. Create a database with name contactdb
  6. Import newsportal.sql file(given inside the zip package in an SQL file folder)
  7. Run the script http://localhost/contactform (frontend)
  8. For admin panel http://localhost/contactform/admin

Credential for Admin Panel:

Username : admin 
Password :Test@123

Project Detail

ERP Company System Program & Software

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis

Point Of Sales Included

Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod

smiling-african-waitress-using-a-restaurant-point-of-sale-terminal-1.jpg
credit-card-retail-customer-and-rfid-payment-at-cashier-store-service-and-point-of-sale-machine-.jpg
Clean & Easy Used

Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod

business-people-pointing-to-graph-and-chart-to-analyze-market-sale-balance-sheet-account-net-pro.jpg
working-with-computer-program.jpg

Composition Program

Project Composition

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

Desktop Programs
0%
Web Based
0%
API Integration
0%

Got a Projects ?