Skip to content

A PHP + MySQL CRUD web application for User Management. It includes Login and Signup for authentication, a User panel for displaying, creating, showing, updating, or deleting each user, and a PDF export option for users list or user details. In this project we will add a new feature: Sending emails with PHPMailer.

License

Notifications You must be signed in to change notification settings

internship-pentatech-it-solutions/crud_add_phpmailer_jcmunav63

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project's name: CRUD Add PHPMailer

main-logo

CRUD Add PHPMailer

📗 Table of Contents

📖 About project - CRUD Add PHPMailer

This CRUD Project application is a PHP project to create a simple CRUD Web Application for users management. In this project we are adding the email sending functionality using the PHPMailer library. This project uses PHP version 8.2.12, MariaDB database server version 10.4.32, and two external libraries called domPDF and PHPMailer. This project is part of the Pentatech IT Solutions PHP Internship program.

🛠 Built With

Tech Stack

Key Features

  • Login and Signup forms, with session management, developed in the first project.
  • Team users dashboard, including name, position, email, photo, and details. All CRUD operations were implemented in the second project.
  • Team users list and user deatils PDF report, using the domPDF library, implemented in the third projec.
  • Email creation and sending usinf¿g the PHPMailer library. This is the fourth project.

(back to top)

💻 Getting Started

To get a local copy up and running, follow these steps.

Prerequisites

In order to run this project you need:

Install XAMPP

Prerequisites: XAMPP application, including Apache web server, PHP (version 8), and MySQL DB server or MariaDB server. You can use a code editor like Visual Studio Code...

Setup

Clone the crud_add_phpmailer_jcmunav63 repo. You can clone this project inside of XAMPP's public folder called htdocs (in Windows C:\xampp\htdocs).

  cd C:\xampp\htdocs
  git clone https://github.com/PentaTech-IT-Solutions/crud_add_phpmailer_jcmunav63

Install

This project requires the following dependencies: the PHP interpreter, the Apache Web Server, a MySQL or MariaDB database server, the dependency manager Composer, and the third-party libraries called domPDF and PHPMailer. The first three components are bundled into XAMPP application (for Windows or Linux). Other similar software applications are WAMP (for Windows), LAMP (for Linux), and MAMP (for Mac). The Composer, the domPDF, and the PHPMailer components are installed using a command terminal.

Database

Create a database using the url "localhost/phpmyadmin" in the browser. The PHPMyAdmin application will open to manage the database server.

You can use the file database/team_management.sql using the import tab of the PHPMyAdmin application. It contains all the information to set up the database to start using it.

The SQL file will create the tables and it will insert some example data. Otherwise, you can also use PHPMyAdmin's graphic interface to create the database and the tables.

The suggested tables to use are...

  • A users table (it will contain 6 columns, id, username, fullname, email, password, phonenumber).
  • A teams table (it will contain 3 columns, id, name, description).
  • A members table, (it will include 8 columns, id, teams_id, first_name, last_name, position, department, about, image_url).

Usage

To run the project, use the browser to enter the following path...

http://localhost/crud_add_phpmailer/index.php

In this home page you will find two links to enter the application, the signup.php form page, if you are not registered yet, or the login.php form page, if you are already registered. http://localhost/crud_add_phpmailer/signup.php

http://localhost/crud_add_phpmailer/login.php

See the images of these two forms below.

Sign up
Sign up

After logging in, the user is redirected to a Team members' Dashboard. Here, the user can Create, Read, Update, or Delete (CRUD) a team member.

Sign up

Here's the form used to Create or Update a team member...

Sign up

And there's also an option to create a new Team, using the following form. The Read, Update, or Delete operations for Teams are also implemented.

Sign up

In the previous projects, we added the CRUD operations for the Team Members displayed on the dashboard page, and the generation of two PDF reports exported from the html content. The first report is the list of members displayed on the dashboard, and the second report is a specific details page, selected from the last name's link on the dashboard. The exported file is shown in the browser, as a pdf file, and it has a download or a print option for the user.

Here are some example images for these two reports...

  • Members list page (dashboard):
Sign up
Sign up
  • Member details page:
Sign up
Sign up

In this report, we added a link to each Team Members to generate an Email. It redirects to an html form where the Team Member's data is pre-loaded and it permits the user to add a SUBJECT, to change or leave today's DATE, and to add a MESSAGE. When the user clicks the send button, the Email is generated and sent using the PHPMailer library, together with an external API SMTP Email Service (MailTrap in my case). The Email is displayed using the HTML format, including a Logo, a Title (or heading), and the data coming from the form: subject, sender's name, sender's email, sender's department, date, and the message.

Here I show some images of the form and the resulting emails.

  • Email form:
Email form
  • Test Email received on MailTrap inbox:
Email message - desktop
Email message - tablet
Email message - phone

(back to top)

👥 Author

👤 Juan Carlos Muñoz

(back to top)

🙏 Acknowledgments

  • I would like to acknowledge all the support and help from PentaTech-IT-Solutions.

(back to top)

📝 License

This project is MIT licensed.

(back to top)

About

A PHP + MySQL CRUD web application for User Management. It includes Login and Signup for authentication, a User panel for displaying, creating, showing, updating, or deleting each user, and a PDF export option for users list or user details. In this project we will add a new feature: Sending emails with PHPMailer.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published