An open API service indexing awesome lists of open source software.

https://github.com/majid-razzaq/send-email-laravel-mailtrap

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.
https://github.com/majid-razzaq/send-email-laravel-mailtrap

contact-form email-form email-sender form laravel-email-template laravel11 mail-send mailtrap mailtrap-io mysql-database send-email

Last synced: 7 months ago
JSON representation

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.

Awesome Lists containing this project

README

          



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)

2) 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.

```javascript
composer install
```

```javascript
php artisan migrate
```

```javascript
php artisan serve
```

## Front-End Template

![screencapture-localhost-8000-2024-09-08-20_07_23](https://github.com/user-attachments/assets/8dec9791-eadf-4c3f-8f33-31e78869ff4e)