Updated - Employee Payslip Generator with Sending Mail using PHP and Gmail SMTP

Language

This article's main purpose is to give updated instructions on the new way of using Gmail SMTP for sending the generated payslip as mail with attachment of the Employee Payslip Generator System that I have published previously. Here, I will show you how to set up your Gmail account using XAMPP's sendmail package. Less Secure Option is not existing anymore on Google, to make the mailing feature of the system still possible, we will use the Google App Password feature for signing in or authenticating.

What is Employee Payslip Generator System?

The Employee Payslip Generator System is a PHP Project that I have published before. The system was developed for a certain company and allows the management to easily calculate the company's employee payroll and generate a PDF payslip. It has a feature to send the generated payslip to their employees' email. The generated payslip is encrypted and the password will be provided only to employees. To know more about the system, visit the Employees Pay Slip PDF Generator System with Email using PHP/OOP Free Source Code article on this site.

System Snapshots

Employees Pay Slip PDF Generator System

Employees Pay Slip PDF Generator System

Setting up Gmail Account as an Email Sender in XAMPP

Here are the steps to set up your Gmail Account as the Email sender of the Employee Payslip Generator System in XAMPP.

Step 1

Go to your Google Accounts page.

Setting up Gmail Account as an Email Sender in XAMPP

Step 2

Next, navigate the page into the Security page. To do that, select the Security menu on the left sidebar of the page.

Setting up Gmail Account as an Email Sender in XAMPP

Step 3

Next, scroll down the page until your reach the Signing into Google card or panel. Then enable the 2-Step Verification. Continue the process of enabling this feature.

Setting up Gmail Account as an Email Sender in XAMPP

Step 4

Next, click the App Passwords menu or option on Signing in to Google card or panel.

Setting up Gmail Account as an Email Sender in XAMPP

Step 5

Then generate a new password for your web server to use to authenticate for using the Gmail SMTP. To do that click the Select app dropdown and choose the Other (Custom name).

Setting up Gmail Account as an Email Sender in XAMPP

Next, write the App Password Name you want and click the Generate button.

Setting up Gmail Account as an Email Sender in XAMPP

Then, a popup modal will show containing the generated password. Copy and paste the generated password securely.

Setting up Gmail Account as an Email Sender in XAMPP

Set up php.ini file Mail Function

After setting up your Google Account, set up the PHP mailing function like the following. Note, use the same value for the SMTP and SMTP_PORT variables. The php.ini file is located in [xampp-directory]/php directory.

Setting up Gmail SMTP in XAMPPs php.ini

Configure sendmail.ini file

Next, configure the sendmail.ini file for Gmail SMTP setup. The file is located in [xampp-directory]/sendmail directory.

Setting up Gmail SMTP in XAMPPs sendmail.ini

That's it! If you don't have the Employees Pay Slip PDF Generator System source code yet. The source code is provided also in this article and is free to download. The download button is located below this article's content.

I hope this Updated - Employee Payslip Generator with Sending Mail using PHP and Gmail SMTP will help you with what you are looking for and will be useful for your current and future PHP Projects.

Explore more on this website for more Tutorials and Free Source Codes.

Enjoy =)

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

Add new comment