Skip to content

This project uses Mailtrap to send emails when a user submits a form. The data is saved in a MySQL database, and the email can be viewed on the Mailtrap website.

Notifications You must be signed in to change notification settings

Majid-Razzaq/send-email-laravel-mailtrap

Repository files navigation

Laravel Logo

Laravel Mailtrap Email Integration

Requirements

  • Laravel = 11.20.0
  • PHP = 8.2.12
  • Composer Version = 2.7.7

How to Use

  1. Configure the Email in the .env File
  • MAIL_MAILER=smtp
  • MAIL_HOST=smtp.mailtrap.io
  • MAIL_PORT=465 # TLS: 587 | SSL: 465
  • MAIL_USERNAME=your-mailtrap-username
  • MAIL_PASSWORD=your-mailtrap-password
  • MAIL_ENCRYPTION=ssl # encryption method: (tls | SSL)
  1. Configure the Email in App/Http/Controllers/FormController.php Mail::to('your-email@example.com')->send(new SendMail($mailData));

Getting Started

  • Clone the repository.
  • Run composer install to install dependencies.
  • Set up your database configuration in the .env file.
  • Run php artisan migrate to create the necessary database tables.
  • Customize the application as needed.
composer install
php artisan migrate
php artisan serve

Front-End Template

screencapture-localhost-8000-2024-09-08-20_07_23

About

This project uses Mailtrap to send emails when a user submits a form. The data is saved in a MySQL database, and the email can be viewed on the Mailtrap website.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published