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.
β Send emails via SMTP π§
β CSRF protection for security π
β SweetAlert2 for user notifications π‘
β Responsive UI with Bootstrap π¨
β AJAX support for seamless requests β‘
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-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
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/
π― Contributions are welcome! If you have suggestions or want to enhance the project, feel free to fork the repository and submit a pull request.
π¬ I love meeting new people and discussing tech, business, and creative ideas. Letβs connect! You can reach me on these platforms: