Skip to content

Latest commit

Β 

History

History
146 lines (129 loc) Β· 5.65 KB

File metadata and controls

146 lines (129 loc) Β· 5.65 KB

πŸ“§ PHP SEND MAIL

This project allows users to send emails via SMTP server using PHP and the PHPMailer library. It features a clean Bootstrap UI and uses SweetAlert2 for better user experience. Banner

πŸ“Œ Features

βœ” Send emails via SMTP πŸ“§
βœ” CSRF protection for security πŸ”
βœ” SweetAlert2 for user notifications πŸ’‘
βœ” Responsive UI with Bootstrap 🎨
βœ” AJAX support for seamless requests ⚑

🎯 Workflow Overview

1️⃣ User fills out the email form and submits.
2️⃣ JavaScript fetch API sends data to send-mail.php.
3️⃣ PHP backend validates data, checks CSRF token, and sends an email using PHPMailer.
4️⃣ SweetAlert2 displays a success/failure notification.

πŸ“‚ Project Structure

/project-root
│── /src/images/logo.svg      # Project logo
│── /vendor                   # Composer dependencies
│── index.php                 # Frontend
│── send-mail.php             # Backend logic for sending emails
│── composer.json             # Composer configuration
│── README.md                 # Documentation

πŸš€ Setup & Installation

1️⃣ Clone the repository:

git clone https://github.com/Iqbolshoh/php-send-mail.git

2️⃣ Navigate to the project directory:

cd php-mailer

3️⃣ Install dependencies via Composer:

composer install

4️⃣ Configure your SMTP settings in send-mail.php:

// SMTP Server Configuration
define('SMTP_HOST', 'mail.yourdomain.com');
define('SMTP_USER', 'your-email@yourdomain.com');
define('SMTP_PASS', 'your-email-password');
define('SMTP_PORT', 465); // 465 for SSL, 587 for TLS

5️⃣ Run the project on a local server:

php -S localhost:8000

6️⃣ Open your browser and go to:

http://localhost:8000/

πŸ–₯ Technologies Used

HTML Bootstrap JavaScript PHP PHPMailer

πŸ“œ License

This project is open-source and available under the MIT License.

🀝 Contributing

🎯 Contributions are welcome! If you have suggestions or want to enhance the project, feel free to fork the repository and submit a pull request.

πŸ“¬ Connect with Me

πŸ’¬ I love meeting new people and discussing tech, business, and creative ideas. Let’s connect! You can reach me on these platforms: