Skip to content

MessageSent event's sent property is empty #55912

@YutaInouePH

Description

@YutaInouePH

Laravel Version

12.16.0

PHP Version

8.3.19

Database Driver & Version

MySQL 8.0.32, php:8.3-fpm-bullseye

Description

The MessageEvent class has a property SentMessage $sent – The message that was sent., but when trying to access via our own listeners, it is shown as an empty object.

Steps To Reproduce

Repository: https://github.com/YutaInouePH/bug-report

Steps to reproduce:

  1. Clone YutaInouePH/bug-report repository
  2. composer install
  3. copy .env
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:AgF1l7QhT7Q8d3YbbyyClAYLTL5KhzwPtcYoqbIiVvk=
APP_DEBUG=true
APP_URL=http://localhost

APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US

APP_MAINTENANCE_DRIVER=file
# APP_MAINTENANCE_STORE=database

PHP_CLI_SERVER_WORKERS=4

BCRYPT_ROUNDS=12

LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=laravel
# DB_USERNAME=root
# DB_PASSWORD=

SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null

BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database

CACHE_STORE=database
# CACHE_PREFIX=

MEMCACHED_HOST=127.0.0.1

REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=log
MAIL_SCHEME=null
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

VITE_APP_NAME="${APP_NAME}"
  1. php artisan serve
  2. Access the top page (/)
  3. The storage/logs/laravel.log shows the email details
[2025-06-03 07:53:31] local.DEBUG: From: Laravel <hello@example.com>
To: test@test.com
Subject: Test Email
MIME-Version: 1.0
Date: Tue, 03 Jun 2025 07:53:31 +0000
Message-ID: <ca46c25d6a07b5c7994e808c1dbe4cab@example.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

This is a test email

but the EmailSentListener's MessageSent object shows like this.

 local.INFO: Email sent {"event":{"Illuminate\\Mail\\Events\\MessageSent":{"sent":[],"data":{"mailer":"log","message":[]}}},"sent":{"Illuminate\\Mail\\SentMessage":[]},"data":{"mailer":"log","message":{"Illuminate\\Mail\\Message":[]}}}

Expected to see some raw message within the MessageSent parameter.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions