Is it possible to use `wp_mail` function on Trellis local/dev environment?

It seems that my local Trellis-powered doesn’t send e-mails. Is this expected?

add_action('init', function() {
	$sent = wp_mail('email@exampl.com', 'my subject, 'my message');
	echo $sent ? 'YEP' : 'NOPE';
	exit;
});

This test function runs without any errors and echoes YEP. Same goes with plain ol’ PHP’s mail function. On my staging/production environment mails are sent without problems. E-mails are, however, not being delivered to my Gmail, not even to spam folders.

I’ve also tried settings e-mail headers to avoid looking spammy to Gmail, From and Reply-to specifically, with my real e-mail address.

Is this expected behaviour? If yes, is it possible to enable e-mail sending on Trellis local environment as well? Would be cool to test any mail-related functionality before deploying.

Thanks in advance!

1 Like

Thanks for a superquick response, missed it totally!

Also a quick note: This is very cool! :ok_hand: