Local Community

How to Use Local Without Sending Emails via SMTP

I’d like to import a live production site into Local to test various changes, but it sounds like emails set to send via SMTP from the website (through a plugin like WP Mail SMTP) will still have email sent from the Local site.

I don’t want emails sent via SMTP (or at all) from this Local site, though (I want everything to be intercepted or just not sent).

How can I import this site without emails being sent from it in Local via SMTP? If import it and then disable the SMTP plugin, it will be too late. Can I disconnect my computer with the Local installation from the internet, import the site to Local, disable the SMTP plugin in the Local installation so that emails are then intercepted by MailHog, and then re-connect my computer back to the internet?

What is the proper way to do this?

I think the terminology that the “WP Mail SMTP” plugin is using on their plugin page makes this topic a bit confusing.

Plain SMTP is just an internet protocol and is the default way that WordPress (and most machines really) uses to send email. If the WordPress site is using “plain smtp” to deliver email, then Local will capture all of those emails and you don’t have to worry about anything.

But reading through the description of the WP Mail SMTP plugin definitely muddies these waters:

WP Mail SMTP plugin easily resolves email delivery problems by improving and changing how your WordPress site sends email. We reconfigure the wp_mail() function to either use proper SMTP host credentials or leverage a built-in SMTP mail provider.

When using one of our built-in SMTP mail provider integrations (recommended), emails are sent using the provider’s direct API. This means even if your web host is blocking SMTP ports, your emails still send successfully.


Basically, the problem is the “direct API” part. It looks like this plugin is sort of a wrapper to help you configure access to third party email delivery systems (SMTP.com, Mailgun, Sendgrid, etc) via that system’s API and not the traditional smtp protocol.

If this plugin doesn’t do anything to disable its functionality depending on the WordPress environment, then yeah, I could see this plugin sending emails even from within the Local site.

Your idea to import the site, disconnect from the internet and then disable to plugin is a decent one and probably would get you what you need.

But if I were you, I’d reach out to their support and see if there are any settings or recommended workflows for using their plugin and working on a site that isn’t in production. You can’t be the only person that wants to use their plugin but also wants to do development on a site in a non-production environments.

If you do get an answer, please reply here so the community can learn more!

So, I ended-up just doing this, and it worked fine. Not a fancy solution, but got the job done. :man_shrugging:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.