Option 1. Edit the .env file in your project root:
MAIL_MAILER=smtp
MAIL_HOST=smtp.postwing.app
MAIL_PORT=8025
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=your_from_email_address
MAIL_FROM_NAME="${APP_NAME}"Option 2. If you need to update the configuration programmatically, you can do it like this:
config([
'mail.mailers.smtp.host' => 'smtp.postwing.app',
'mail.mailers.smtp.port' => 8025,
'mail.mailers.smtp.username' => 'your_username',
'mail.mailers.smtp.password' => 'your_password',
'mail.mailers.smtp.encryption' => null,
]);Option 3. You can also edit config/mail.php directly:
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.postwing.app'),
'port' => env('MAIL_PORT', 8025),
'encryption' => env('MAIL_ENCRYPTION', null),
'username' => env('MAIL_USERNAME', 'your_username'),
'password' => env('MAIL_PASSWORD', 'your_password'),
'timeout' => null,
'auth_mode' => null,
],After applying the changes, don’t forget to clear the Laravel cache:
php artisan config:clearFor testing you can use Laravel’s Mail facade:
Mail::to('recipient@example.com')->send(new \App\Mail\TestEmail());