Title: Force Email Simulation via PHP
Last modified: February 16, 2026

---

# Force Email Simulation via PHP

 *  Resolved [KratosGemini](https://wordpress.org/support/users/kratosgemini/)
 * (@kratosgemini)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/force-email-simulation-via-php/)
 * Is there an easy way to force Email Simulation via PHP, like an optional constant
   or filter?
 * This would be very helpful for development and staging environments. We currently
   do something similar with our current SMTP plugin, but we are looking to switch
   to a better one. But I don’t see a supported way to do this with SureMail, unless
   I’m missing something.
 * Thanks for your help.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Avinash Kumar Sharma](https://wordpress.org/support/users/avi1020p/)
 * (@avi1020p)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/force-email-simulation-via-php/#post-18824362)
 * Hello [@kratosgemini](https://wordpress.org/support/users/kratosgemini/),
 * Thank you for reaching out 🙂
 * I checked this with our development team, and we would need a bit more detail
   on what exactly you would like to achieve using a constant or filter.
 * Currently, SureMail already includes a built-in **Email Simulation** feature 
   that you can enable from the dashboard:
    1. Go to **SureMail > Settings**
    2. Scroll down to **Email Simulation**
    3. Enable the checkbox to activate it
 * Once enabled, emails will be simulated instead of being sent.
 * You can also refer to our documentation here for more details:
   [https://suremails.com/docs/email-simulation/](https://suremails.com/docs/email-simulation/)
 * If you can share a bit more about your specific use case (for example, environment-
   based automation), we’ll be happy to discuss it further with the team and see
   how we can improve this experience.
 * Looking forward to your response.
   Best Regards,Avinash
 *  Thread Starter [KratosGemini](https://wordpress.org/support/users/kratosgemini/)
 * (@kratosgemini)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/force-email-simulation-via-php/#post-18825258)
 * Environment-based automation is exactly the reason. To avoid unintended side-
   effects when using staging or local development environments, we have code that
   detects a non-production environment and disables or reroutes certain features.
   One of the features that is very important to disable is live email sending. 
   Otherwise, clients could get emails with URLs from our development or staging
   environments (and to make matters more confusing, these would be duplicate emails).
 * There are various reasons why unwanted sending of live emails could be triggered
   on a non-production site without any developer intervention. For example, if 
   there is a process that sends a follow-up email at a certain time (such as paying
   the balance of a product that had a deposit paid). This has happened before, 
   which is why we included code to disable functions like this.
 * Our current email plugin has a constant that when defined, does email simulation.
   So our code sets this constant automatically on non-production environments. 
   Another alternate email plugin I’ve tested out, FluentSMTP, also provides such
   functionality via an optionally defined constant. However, I’m endeavoring to
   go with SureMail in the hopes that one day this unrelated feature will be added:
   [https://ideas.suremails.com/boards/feature-requests/posts/permissions-to-view-email-log-for-non-admins](https://ideas.suremails.com/boards/feature-requests/posts/permissions-to-view-email-log-for-non-admins).(
   I’ve asked FluentSMTP about adding that feature, but as of now they have no plans
   to.) Aside from this email simulation issue, FluentSMTP is equivalent. So my 
   desire to use SureMail is a hope that maybe some day the non-admin email log 
   viewing feature will be added (which would make our lives better). However, not
   being able to automate the enabling of email simulation is a deal-breaker for
   switching for us.
 * Does that help?
 * Thanks for considering.
 * P.S. In case it’s not clear, our staging and development environments are copies
   of our production environments that are refreshed on occasion. This ensures that
   things like new pages or products make their way over to our staging and development
   environments. But this also means that those environments contain already in-
   process real customer interactions. Hence, the issue if delayed emails are sent.
   Our process makes testing things on other environments very convenient with minimal
   manual changes, but it has the side-effect of being problematic if certain processes
   like emails, webhooks, etc. run on those environments without alternations.
    -  This reply was modified 3 months, 3 weeks ago by [KratosGemini](https://wordpress.org/support/users/kratosgemini/).
      Reason: Added more detail
 *  Plugin Support [Avinash Kumar Sharma](https://wordpress.org/support/users/avi1020p/)
 * (@avi1020p)
 * [3 months, 2 weeks ago](https://wordpress.org/support/topic/force-email-simulation-via-php/#post-18832291)
 * Hello [@kratosgemini](https://wordpress.org/support/users/kratosgemini/) ,
 * Thank you for sharing more details about your query.
 * I have discussed this with our development team, and we’ve added it as a task
   to our development roadmap.
 * You can also submit this request on our public ideas board so other users can
   upvote it:
   [https://ideas.suremails.com/boards/feature-requests](https://ideas.suremails.com/boards/feature-requests).
 * For now, you can continue using the email simulation option available in the 
   plugin settings.
 * Please feel free to let us know if you have any other questions. We’re happy 
   to help.
   Best Regards,Avinash
 *  Thread Starter [KratosGemini](https://wordpress.org/support/users/kratosgemini/)
 * (@kratosgemini)
 * [3 months, 1 week ago](https://wordpress.org/support/topic/force-email-simulation-via-php/#post-18834109)
 * I submitted the feature request. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fforce-email-simulation-via-php%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/suremails/assets/icon-256x256.gif?rev=3235320)
 * [SureMail – SMTP and Email Logs Plugin with Amazon SES, Postmark, and Other Providers](https://wordpress.org/plugins/suremails/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/suremails/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/suremails/)
 * [Active Topics](https://wordpress.org/support/plugin/suremails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/suremails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/suremails/reviews/)

## Tags

 * [development](https://wordpress.org/support/topic-tag/development/)
 * [simulation](https://wordpress.org/support/topic-tag/simulation/)
 * [staging](https://wordpress.org/support/topic-tag/staging/)

 * 4 replies
 * 2 participants
 * Last reply from: [KratosGemini](https://wordpress.org/support/users/kratosgemini/)
 * Last activity: [3 months, 1 week ago](https://wordpress.org/support/topic/force-email-simulation-via-php/#post-18834109)
 * Status: resolved