Learn how to use the PHPMailer library in XAMPP localhost as well as on a real Linux server. We are going to learn how to send emails in PHP via Gmail SMTP and how to generate and use an app password for your Google account. PHPMailer is a popular and widely used PHP library for sending emails via SMTP (Simple Mail Transfer Protocol). It simplifies the process of creating and sending emails from a web application.
🎞️ TABLE OF CONTENTS 🎬
0:00 Introduction
0:45 PHPMailer library installation
1:36 Install PHPMailer with Composer
3:33 Code an email sender script
4:23 Directory handling (vendor/autoload.php)
5:09 Define Gmail SMTP server settings in PHPMailer
5:44 How to generate a Google app password
7:16 Define protocol and port in PHPMailer (TLS/SSL)
7:40 Define email sender and recipients in PHPMailer
8:03 Send testing emails via PHPMailer on localhost
9:04 How to send attachments with PHPMailer
10:16 How to embed images in an email body
13:12 Run PHPMailer on a real server (live Linux server)
15:18 End Screen
📧 PHPMailer Library
🔗 https://github.com/PHPMailer/PHPMailer
📨 My Email Sender Script
🔗 https://gist.github.com/saeedkohansal...
📥 Download Source Code (Includes assets)
🔗 https://drive.google.com/file/d/1mEvp...
📦 Download Composer
🔗 https://getcomposer.org/
🔒 Google App Passwords Settings
🔗 https://myaccount.google.com/apppassw...
⏯️ By watching this video, you will learn:
🔴 How to install and use the PHPMailer library with Composer
🟢 How to generate a Google App password for a Google account
🔵 How to send attachments in email with PHP using PHPMailer
🟡 How to embed images in the email body with PHPMailer
🟠 How to connect Gmail SMTP in PHP for sending emails
🟣 How to use Gmail SMTP in XAMPP localhost for sending emails
#webdevelopment #php #backendwebdevelopment #smtp #gilgeekify