Local + Mailpit: Mailpit does not show from address given by apply_filter "wp_mail_from"

What issue or error are you experiencing?

I am building a specialised mail facility in Local, before uploading the site to live. I need to test it. It is necessary that the person using it be able to choose which of their email accounts to use.

I am using apply_filters(“wp_mail_from”, $sending_address); where that variable is given by the user. I can’t test this feature as Mailpit always gives

What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc


System Details

  • **Local Version:**Version 9.2.9+6887

  • Operating System (OS) and OS version: macOS 15.7.3


Local Logs

local-lightning-verbose.log (705.1 KB)

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hi @davidjazz!

This is a limitation of Local + Mailpit as it will always display that email address formatted as you shared it. If you check the headers in Mailpit, you should still see the original selected addresses which would indicate your test is working.

An alternative test would be to use a Staging or Development environment on your server/host before the final push to Production. That way you can more accurately replicate the environment as close as possible.

Thank you. That is what I expected. And thanks for the speedy reply.

1 Like

Of course! Thank you for reaching out :green_heart: