Seeing mail stored by mail collector in Drupal 9 not just word array

drush sget system.test_mail_collector just gave Array. Yeah, the word array.

The secret is var_dump


drush sget system.test_mail_collector --format=var_dump

Updated to include this format part— without providing a forgiving format, you can get just ‘array’ or an error from this state get command.

In our case, on DDEV, we would much rather these e-mails end up in mailhog, so on this old site which was using Swiftmail we changed the config in settings.local.php to have these overrides:

$config['swiftmailer.transport']['transport'] = 'smtp';
$config['swiftmailer.transport']['smtp_host'] = 'localhost';
$config['swiftmailer.transport']['smtp_port'] = '1025';