<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mailyo</title>
    <description>The latest articles on DEV Community by Mailyo (@mailyo).</description>
    <link>https://dev.to/mailyo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4158195%2Ff0e843cc-12b9-4165-b6a8-c6d251d82fe4.png</url>
      <title>DEV Community: Mailyo</title>
      <link>https://dev.to/mailyo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mailyo"/>
    <language>en</language>
    <item>
      <title>Temporary Email vs Mocking Email: What Should Developers Test?</title>
      <dc:creator>Mailyo</dc:creator>
      <pubDate>Fri, 02 Oct 2026 17:57:07 +0000</pubDate>
      <link>https://dev.to/mailyo/temporary-email-vs-mocking-email-what-should-developers-test-4ojj</link>
      <guid>https://dev.to/mailyo/temporary-email-vs-mocking-email-what-should-developers-test-4ojj</guid>
      <description>&lt;p&gt;Email is often one of the most overlooked parts of application testing.&lt;/p&gt;

&lt;p&gt;A signup form might work perfectly in the browser, but that doesn't necessarily mean the complete email workflow works correctly.&lt;/p&gt;

&lt;p&gt;Your application may need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Send verification emails&lt;/li&gt;
&lt;li&gt;Deliver OTP codes&lt;/li&gt;
&lt;li&gt;Send password-reset links&lt;/li&gt;
&lt;li&gt;Confirm email changes&lt;/li&gt;
&lt;li&gt;Send account notifications&lt;/li&gt;
&lt;li&gt;Handle bounced or invalid addresses&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Developers therefore have several ways to test email functionality.&lt;/p&gt;

&lt;p&gt;Two common approaches are &lt;strong&gt;mocking email&lt;/strong&gt; and using a &lt;strong&gt;real or temporary inbox&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;They solve different problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Email Mocking?
&lt;/h2&gt;

&lt;p&gt;Email mocking means replacing the real email delivery process with a controlled testing environment.&lt;/p&gt;

&lt;p&gt;Instead of sending an email through your normal infrastructure, the application sends the message to a test system where you can inspect it.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Application
    ↓
Email service
    ↓
Test email server
    ↓
Captured message
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing needs to reach a real inbox.&lt;/p&gt;

&lt;p&gt;This is useful during development because you can inspect the message without worrying about sending test emails to real users.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Can You Test With Mocked Email?
&lt;/h2&gt;

&lt;p&gt;Mocking is particularly useful for checking the contents of an email.&lt;/p&gt;

&lt;p&gt;You can test:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Subject lines&lt;/li&gt;
&lt;li&gt;HTML structure&lt;/li&gt;
&lt;li&gt;Plain-text versions&lt;/li&gt;
&lt;li&gt;Verification URLs&lt;/li&gt;
&lt;li&gt;OTP codes&lt;/li&gt;
&lt;li&gt;Dynamic user information&lt;/li&gt;
&lt;li&gt;Email templates&lt;/li&gt;
&lt;li&gt;Headers&lt;/li&gt;
&lt;li&gt;Links and buttons&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, you might verify that an email contains:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Subject: Verify your account

Hello John,

Please verify your email address.

[Verify Email]

This link expires in 30 minutes.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This type of test can run quickly and repeatedly.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Does a Temporary Inbox Test?
&lt;/h2&gt;

&lt;p&gt;A temporary inbox approaches the problem from the user's perspective.&lt;/p&gt;

&lt;p&gt;Instead of only checking whether your application generated the correct email, you check whether the message can actually reach an inbox.&lt;/p&gt;

&lt;p&gt;The flow might be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create test account
        ↓
Generate temporary email
        ↓
Submit registration
        ↓
Application sends email
        ↓
Email reaches inbox
        ↓
Open verification message
        ↓
Click verification link
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tests more of the actual user journey.&lt;/p&gt;

&lt;p&gt;For low-risk manual testing, a service such as &lt;a href="https://mailyo.cc/" rel="noopener noreferrer"&gt;Mailyo &lt;/a&gt;can provide a temporary inbox without requiring you to use your personal email address.&lt;/p&gt;

&lt;h2&gt;
  
  
  These Tests Are Not the Same
&lt;/h2&gt;

&lt;p&gt;One of the most important distinctions is that mocking and real inbox testing answer different questions.&lt;/p&gt;

&lt;p&gt;Mocking asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Did my application generate the correct email?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;An inbox-based test asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Can the user actually receive and use the email?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Both questions can be valuable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example: Testing a Verification Email
&lt;/h2&gt;

&lt;p&gt;Imagine your application sends an account verification email.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mocked test
&lt;/h3&gt;

&lt;p&gt;You could verify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Email generated
✓ Correct recipient
✓ Correct subject
✓ Correct verification URL
✓ Correct expiration time
✓ Correct HTML
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is fast and deterministic.&lt;/p&gt;

&lt;h3&gt;
  
  
  Inbox test
&lt;/h3&gt;

&lt;p&gt;You could verify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Registration completed
✓ Email delivered
✓ Message appears in inbox
✓ Verification link opens
✓ Account becomes verified
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tests a larger portion of the system.&lt;/p&gt;

&lt;h2&gt;
  
  
  What About OTP Emails?
&lt;/h2&gt;

&lt;p&gt;OTP-based authentication introduces additional cases.&lt;/p&gt;

&lt;p&gt;Suppose your application sends:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your verification code is 482913
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should test more than whether the email exists.&lt;/p&gt;

&lt;p&gt;Consider testing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Correct code&lt;/li&gt;
&lt;li&gt;Incorrect code&lt;/li&gt;
&lt;li&gt;Expired code&lt;/li&gt;
&lt;li&gt;Previously used code&lt;/li&gt;
&lt;li&gt;Multiple requested codes&lt;/li&gt;
&lt;li&gt;Rate limits&lt;/li&gt;
&lt;li&gt;Resending a code&lt;/li&gt;
&lt;li&gt;Code length&lt;/li&gt;
&lt;li&gt;Numeric versus alphanumeric codes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A mocked email system can make these tests easy to control.&lt;/p&gt;

&lt;p&gt;A real inbox test can help verify that the actual delivery flow works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Not Use a Real Personal Inbox?
&lt;/h2&gt;

&lt;p&gt;Using your personal email for automated or repeated testing can become inconvenient very quickly.&lt;/p&gt;

&lt;p&gt;You may create dozens of test messages every day.&lt;/p&gt;

&lt;p&gt;Your inbox could eventually contain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Verification email
Password reset
Welcome email
Verification email
Test notification
Password reset
Welcome email
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It also makes it harder to distinguish development activity from real communication.&lt;/p&gt;

&lt;p&gt;For this reason, testing environments should have their own email strategy.&lt;/p&gt;

&lt;h2&gt;
  
  
  When Should You Use Mocking?
&lt;/h2&gt;

&lt;p&gt;Email mocking is useful when you need:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fast tests&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You don't want every unit or integration test waiting for an external mail provider.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Predictable results&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The test environment should behave consistently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Template testing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You want to inspect generated HTML and content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CI/CD testing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Automated pipelines benefit from deterministic infrastructure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Error simulation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can intentionally simulate delivery failures and other conditions.&lt;/p&gt;

&lt;h2&gt;
  
  
  When Is an Inbox Test Useful?
&lt;/h2&gt;

&lt;p&gt;An inbox-based test can be useful when you need to verify the complete experience.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Manual QA&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A tester wants to confirm that registration works from beginning to end.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Staging testing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You want to verify that your staging environment can actually deliver emails.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verification workflows&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You need to confirm that links or OTPs work after delivery.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-world integration testing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You want to test more than just the email-generation code.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Combined Testing Strategy
&lt;/h2&gt;

&lt;p&gt;You don't necessarily have to choose one approach.&lt;/p&gt;

&lt;p&gt;A strong testing strategy can use both.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    Email Tests
                         │
             ┌───────────┴───────────┐
             │                       │
          Mocking                Inbox Test
             │                       │
      Fast automated tests      End-to-end tests
             │                       │
      Template validation       Delivery validation
             │                       │
      Error simulation         User experience
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your unit and integration tests can use mocked email infrastructure.&lt;/p&gt;

&lt;p&gt;Your end-to-end tests can use a dedicated testing inbox.&lt;/p&gt;

&lt;p&gt;Manual QA can use either a dedicated mailbox or a temporary email address when appropriate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Don't Forget Email Security
&lt;/h2&gt;

&lt;p&gt;Email testing should also consider security.&lt;/p&gt;

&lt;p&gt;Check that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Verification tokens aren't predictable&lt;/li&gt;
&lt;li&gt;Tokens expire correctly&lt;/li&gt;
&lt;li&gt;Tokens can't be reused&lt;/li&gt;
&lt;li&gt;Password-reset links aren't exposed unnecessarily&lt;/li&gt;
&lt;li&gt;Users cannot verify another account&lt;/li&gt;
&lt;li&gt;Sensitive information isn't included in email URLs&lt;/li&gt;
&lt;li&gt;Expired links are rejected&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Temporary email doesn't change these requirements.&lt;/p&gt;

&lt;p&gt;It is simply one possible testing input.&lt;/p&gt;

&lt;h2&gt;
  
  
  What About Mailyo?
&lt;/h2&gt;

&lt;p&gt;For a quick manual test, &lt;a href="https://mailyo.cc/" rel="noopener noreferrer"&gt;Mailyo &lt;/a&gt;can be used to create a temporary email address and check whether a low-risk registration or verification email arrives.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Open Mailyo
    ↓
Generate temporary email
    ↓
Use address in test signup
    ↓
Wait for verification email
    ↓
Open message
    ↓
Test verification link
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For long-running automated test suites, however, you may want a dedicated email-testing solution with predictable APIs and controlled test data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Mocking email and testing with a real inbox aren't competing techniques.&lt;/p&gt;

&lt;p&gt;They test different layers of your application.&lt;/p&gt;

&lt;p&gt;Use mocked email when you need fast, predictable tests around email generation and application logic.&lt;/p&gt;

&lt;p&gt;Use an inbox-based test when you need to verify delivery and the complete user experience.&lt;/p&gt;

&lt;p&gt;For many development teams, combining both approaches provides better coverage than relying on either one alone.&lt;/p&gt;

&lt;p&gt;The important question isn't &lt;strong&gt;“Which one is better?”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;“Which part of the email workflow am I trying to test?”&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>backend</category>
      <category>softwaredevelopment</category>
      <category>testing</category>
    </item>
    <item>
      <title>How to Test Email Verification in Playwright</title>
      <dc:creator>Mailyo</dc:creator>
      <pubDate>Fri, 02 Oct 2026 17:51:10 +0000</pubDate>
      <link>https://dev.to/mailyo/how-to-test-email-verification-in-playwright-4ped</link>
      <guid>https://dev.to/mailyo/how-to-test-email-verification-in-playwright-4ped</guid>
      <description>&lt;p&gt;Email verification is a common part of modern web applications.&lt;/p&gt;

&lt;p&gt;A typical registration flow looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User signs up
    ↓
Verification email is sent
    ↓
User opens email
    ↓
User clicks verification link
    ↓
Account becomes verified
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Manually testing this flow works, but it becomes repetitive when you're running the same test dozens or hundreds of times.&lt;/p&gt;

&lt;p&gt;That's where browser automation tools such as &lt;strong&gt;Playwright&lt;/strong&gt; can help.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Should the Test Verify?
&lt;/h2&gt;

&lt;p&gt;A basic Playwright test should confirm that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A user can register successfully&lt;/li&gt;
&lt;li&gt;A verification email is generated&lt;/li&gt;
&lt;li&gt;The email reaches the expected inbox&lt;/li&gt;
&lt;li&gt;The verification link works&lt;/li&gt;
&lt;li&gt;The account changes to a verified state&lt;/li&gt;
&lt;li&gt;Invalid or expired links are handled correctly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal isn't simply to check that an email was sent. You want to test the complete user journey.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Basic Playwright Flow
&lt;/h2&gt;

&lt;p&gt;A simplified automated test could look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;expect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@playwright/test&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user can verify their email&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://example.com/signup&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByLabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Email&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;test@example.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByLabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Password&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TestPassword123&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByRole&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;button&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Create account&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;click&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Check your email&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBeVisible&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This verifies the registration side of the process.&lt;/p&gt;

&lt;p&gt;But there's still an important question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Did the verification email actually arrive?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing the Email Side
&lt;/h2&gt;

&lt;p&gt;For a complete end-to-end test, your test environment needs access to the email generated by the application.&lt;/p&gt;

&lt;p&gt;There are several ways to approach this.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 1: Dedicated Test Mailbox
&lt;/h3&gt;

&lt;p&gt;Create a mailbox specifically for automated testing.&lt;/p&gt;

&lt;p&gt;This provides a controlled environment and is usually a good choice for stable CI/CD tests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 2: Email Testing Service
&lt;/h3&gt;

&lt;p&gt;An email-testing service can capture outgoing messages without sending them to real users.&lt;/p&gt;

&lt;p&gt;This can be useful when you need to inspect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Email HTML&lt;/li&gt;
&lt;li&gt;Subject lines&lt;/li&gt;
&lt;li&gt;Links&lt;/li&gt;
&lt;li&gt;Headers&lt;/li&gt;
&lt;li&gt;Attachments&lt;/li&gt;
&lt;li&gt;Delivery behavior&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Option 3: Temporary Email
&lt;/h3&gt;

&lt;p&gt;For manual or short-lived testing, a temporary email address can be convenient.&lt;/p&gt;

&lt;p&gt;For example, you can generate a temporary address with &lt;a href="https://mailyo.cc/" rel="noopener noreferrer"&gt;Mailyo&lt;/a&gt;, use it during registration, and check whether the verification email arrives.&lt;/p&gt;

&lt;p&gt;This approach can be useful when you're testing a website manually and don't want to use your personal inbox.&lt;/p&gt;

&lt;p&gt;However, public temporary inboxes aren't necessarily appropriate for automated production test infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Extracting a Verification Link
&lt;/h2&gt;

&lt;p&gt;Once your test system can access the email, the next step is to extract the verification URL.&lt;/p&gt;

&lt;p&gt;Conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;getLatestTestEmail&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;verificationLink&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;extractVerificationLink&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;verificationLink&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Email verified&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBeVisible&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exact implementation depends on your email-testing infrastructure.&lt;/p&gt;

&lt;p&gt;The important part is keeping the browser test and email retrieval process reliable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test More Than Successful Verification
&lt;/h2&gt;

&lt;p&gt;A common mistake is testing only the happy path.&lt;/p&gt;

&lt;p&gt;Your application should also handle unusual situations.&lt;/p&gt;

&lt;h3&gt;
  
  
  Expired Link
&lt;/h3&gt;

&lt;p&gt;What happens when the user clicks an expired verification link?&lt;/p&gt;

&lt;p&gt;Expected behavior might be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Verification link expired
        ↓
Show helpful message
        ↓
Offer "Send new link"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Invalid Link
&lt;/h3&gt;

&lt;p&gt;Try changing part of the verification URL.&lt;/p&gt;

&lt;p&gt;The application should reject the request rather than verifying the account.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multiple Verification Emails
&lt;/h3&gt;

&lt;p&gt;Request verification several times.&lt;/p&gt;

&lt;p&gt;Make sure your application has a clearly defined behavior for old and new links.&lt;/p&gt;

&lt;h3&gt;
  
  
  Already Verified Account
&lt;/h3&gt;

&lt;p&gt;Try opening a verification link after the account has already been verified.&lt;/p&gt;

&lt;p&gt;The application should handle this gracefully.&lt;/p&gt;

&lt;h2&gt;
  
  
  Avoid Hard-Coded Test Accounts
&lt;/h2&gt;

&lt;p&gt;Don't build your test around one permanent account if you can avoid it.&lt;/p&gt;

&lt;p&gt;For example, this can become problematic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;playwright-test@example.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After many test runs, you may have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Existing accounts&lt;/li&gt;
&lt;li&gt;Used verification links&lt;/li&gt;
&lt;li&gt;Conflicting database records&lt;/li&gt;
&lt;li&gt;Duplicate-email errors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead, generate unique test data when appropriate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
  &lt;span class="s2"&gt;`test-&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;&lt;span class="s2"&gt;@example.test`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your test environment can then treat every execution as a fresh registration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep Test Email Separate
&lt;/h2&gt;

&lt;p&gt;It's a good practice to separate testing email from personal and production email.&lt;/p&gt;

&lt;p&gt;A useful environment might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Production
    ↓
Real users
    ↓
Production email system

Testing
    ↓
Automated tests
    ↓
Test email system
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This separation reduces the risk of test messages reaching real users.&lt;/p&gt;

&lt;h2&gt;
  
  
  Temporary Email Isn't a Replacement for Test Infrastructure
&lt;/h2&gt;

&lt;p&gt;Temporary email can be useful, but it shouldn't automatically become your entire email-testing strategy.&lt;/p&gt;

&lt;p&gt;For serious automated testing, consider using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A dedicated test mailbox&lt;/li&gt;
&lt;li&gt;An email sandbox&lt;/li&gt;
&lt;li&gt;Local SMTP testing&lt;/li&gt;
&lt;li&gt;A test email API&lt;/li&gt;
&lt;li&gt;A staging email environment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use temporary email where it makes sense, particularly for short-lived manual testing and low-risk registration tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Practical Playwright Testing Strategy
&lt;/h2&gt;

&lt;p&gt;A reasonable testing setup might be:&lt;/p&gt;

&lt;h3&gt;
  
  
  Local development
&lt;/h3&gt;

&lt;p&gt;Use a local email catcher or SMTP testing tool.&lt;/p&gt;

&lt;h3&gt;
  
  
  Manual QA
&lt;/h3&gt;

&lt;p&gt;Use a dedicated test mailbox or temporary email address.&lt;/p&gt;

&lt;h3&gt;
  
  
  CI/CD
&lt;/h3&gt;

&lt;p&gt;Use deterministic email-testing infrastructure that your automated tests can reliably query.&lt;/p&gt;

&lt;h3&gt;
  
  
  Production
&lt;/h3&gt;

&lt;p&gt;Never use test accounts or temporary inboxes to interact with real customer data.&lt;/p&gt;

&lt;p&gt;This keeps each environment predictable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Playwright makes it relatively easy to automate the browser portion of email verification testing.&lt;/p&gt;

&lt;p&gt;The harder part is connecting your automated test to the email system.&lt;/p&gt;

&lt;p&gt;For manual testing, a temporary email service such as &lt;strong&gt;&lt;a href="https://mailyo.cc/" rel="noopener noreferrer"&gt;Mailyo&lt;/a&gt;&lt;/strong&gt; can provide a quick way to test registration and verification without filling your personal inbox.&lt;/p&gt;

&lt;p&gt;For automated CI/CD testing, however, a dedicated test email system will usually provide more control and reliability.&lt;/p&gt;

&lt;p&gt;The best setup depends on whether you're testing manually, locally, or as part of a continuous integration pipeline.&lt;/p&gt;

&lt;p&gt;The important thing is to test the &lt;strong&gt;entire verification journey&lt;/strong&gt;, not just the signup button.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Test Email Verification Flows Without Using Your Personal Inbox</title>
      <dc:creator>Mailyo</dc:creator>
      <pubDate>Fri, 02 Oct 2026 17:45:51 +0000</pubDate>
      <link>https://dev.to/mailyo/how-to-test-email-verification-flows-without-using-your-personal-inbox-12eg</link>
      <guid>https://dev.to/mailyo/how-to-test-email-verification-flows-without-using-your-personal-inbox-12eg</guid>
      <description>&lt;p&gt;Email verification is one of those features that looks simple until you have to test it repeatedly.&lt;/p&gt;

&lt;p&gt;A typical signup flow might look like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User &lt;a href="https://mailyo.cc/" rel="noopener noreferrer"&gt;creates &lt;/a&gt;an account.&lt;/li&gt;
&lt;li&gt;The application sends a verification email.&lt;/li&gt;
&lt;li&gt;User opens the email.&lt;/li&gt;
&lt;li&gt;User clicks a verification link or enters an OTP.&lt;/li&gt;
&lt;li&gt;The account becomes verified.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For developers and QA engineers, testing this flow can quickly fill a personal inbox with test emails.&lt;/p&gt;

&lt;p&gt;A temporary email address can be useful for low-risk testing when the service being tested accepts disposable addresses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use a Separate Email for Testing?
&lt;/h2&gt;

&lt;p&gt;Using your personal email for development and QA testing can create several problems.&lt;/p&gt;

&lt;p&gt;You may end up with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dozens of verification emails&lt;/li&gt;
&lt;li&gt;Password-reset messages&lt;/li&gt;
&lt;li&gt;Test account notifications&lt;/li&gt;
&lt;li&gt;Marketing emails triggered by test registrations&lt;/li&gt;
&lt;li&gt;Multiple accounts associated with the same address&lt;/li&gt;
&lt;li&gt;Difficulty finding real messages among test data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A separate testing mailbox solves some of these problems.&lt;/p&gt;

&lt;p&gt;For short-lived tests, a temporary inbox can be another option.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Simple Email Verification Test
&lt;/h2&gt;

&lt;p&gt;Imagine you're testing a new web application.&lt;/p&gt;

&lt;p&gt;You want to verify that registration works correctly.&lt;/p&gt;

&lt;p&gt;Instead of using your normal email address, generate a temporary email address and enter it into the signup form.&lt;/p&gt;

&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Open signup page
      ↓
Enter temporary email
      ↓
Create account
      ↓
Application sends verification email
      ↓
Open temporary inbox
      ↓
Read verification email
      ↓
Click verification link
      ↓
Account becomes verified
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives you a clean email address for the test.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Should You Test?
&lt;/h2&gt;

&lt;p&gt;Receiving the email is only one part of the process.&lt;/p&gt;

&lt;p&gt;A useful QA checklist includes:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Email delivery
&lt;/h3&gt;

&lt;p&gt;Check whether the verification email arrives successfully.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Correct recipient
&lt;/h3&gt;

&lt;p&gt;Make sure the email is delivered to the address used during registration.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Verification link
&lt;/h3&gt;

&lt;p&gt;Click the link and confirm that the application correctly verifies the account.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. OTP verification
&lt;/h3&gt;

&lt;p&gt;If the application uses a verification code, confirm that the code is correct and accepted.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Expired verification links
&lt;/h3&gt;

&lt;p&gt;Test what happens when a verification link has expired.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Resend functionality
&lt;/h3&gt;

&lt;p&gt;Request another verification email and make sure the newest message works correctly.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Invalid codes
&lt;/h3&gt;

&lt;p&gt;Enter an incorrect OTP and verify that the application displays an appropriate error.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Already verified accounts
&lt;/h3&gt;

&lt;p&gt;Try opening an old verification link after the account has already been verified.&lt;/p&gt;

&lt;p&gt;These edge cases often reveal bugs that a basic "email arrived" test won't catch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Temporary Email Can Help
&lt;/h2&gt;

&lt;p&gt;Temporary email is particularly useful for short-lived and low-risk testing scenarios.&lt;/p&gt;

&lt;p&gt;For example, you might need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Test a registration form&lt;/li&gt;
&lt;li&gt;Check email verification&lt;/li&gt;
&lt;li&gt;Test an OTP flow&lt;/li&gt;
&lt;li&gt;Create a temporary demo account&lt;/li&gt;
&lt;li&gt;Verify password-reset functionality&lt;/li&gt;
&lt;li&gt;Test whether transactional emails are being sent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://mailyo.cc/" rel="noopener noreferrer"&gt;Mailyo &lt;/a&gt;is one option for generating a temporary email address without using your normal inbox.&lt;/p&gt;

&lt;p&gt;However, temporary email isn't appropriate for every situation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Don't Use Temporary Email for Sensitive Accounts
&lt;/h2&gt;

&lt;p&gt;A temporary inbox should not be treated like a secure personal mailbox.&lt;/p&gt;

&lt;p&gt;Avoid using disposable addresses for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Banking accounts&lt;/li&gt;
&lt;li&gt;Important personal accounts&lt;/li&gt;
&lt;li&gt;Password recovery for important services&lt;/li&gt;
&lt;li&gt;Private documents&lt;/li&gt;
&lt;li&gt;Sensitive business information&lt;/li&gt;
&lt;li&gt;Accounts you need to keep permanently&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For these situations, use a normal email account that you control.&lt;/p&gt;

&lt;h2&gt;
  
  
  What About Automated Testing?
&lt;/h2&gt;

&lt;p&gt;For automated tests, temporary email can become more complicated.&lt;/p&gt;

&lt;p&gt;A production-grade automated test suite may be better served by a dedicated testing mailbox, a local SMTP testing tool, or an email-testing API.&lt;/p&gt;

&lt;p&gt;For example, a CI pipeline might use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Application
    ↓
Create test account
    ↓
Send verification email
    ↓
Test email system
    ↓
Retrieve message
    ↓
Extract verification link
    ↓
Complete test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important part is making the email system deterministic and reliable.&lt;/p&gt;

&lt;p&gt;A public temporary inbox may be useful for manual testing, but it isn't necessarily the right infrastructure for every automated test environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep Your Tests Separate From Production
&lt;/h2&gt;

&lt;p&gt;One of the best practices is to keep testing environments isolated.&lt;/p&gt;

&lt;p&gt;If possible, use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Test domains&lt;/li&gt;
&lt;li&gt;Test databases&lt;/li&gt;
&lt;li&gt;Dedicated email addresses&lt;/li&gt;
&lt;li&gt;Separate API credentials&lt;/li&gt;
&lt;li&gt;Separate user accounts&lt;/li&gt;
&lt;li&gt;Staging environments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This reduces the chance of accidentally sending test emails to real users or modifying production data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Email verification deserves the same attention as any other part of your application.&lt;/p&gt;

&lt;p&gt;For manual testing, a temporary email address can help keep test registrations away from your personal inbox. For automated and production-like testing, dedicated email infrastructure may be more appropriate.&lt;/p&gt;

&lt;p&gt;The right choice depends on what you're testing, how sensitive the account is, and whether the test needs a temporary or permanent mailbox.&lt;/p&gt;

&lt;p&gt;The main goal is simple: &lt;strong&gt;keep test data separate, make email flows repeatable, and never use temporary email for information that needs long-term security or access.&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
