What temp email platform to use so I can get the otp sent? #28566
Replies: 2 comments
-
|
I have created my own service which supports devs and automation e2e..:) if u find any bug or issues just contact me, i will try to fix that asap.. here is the site: https://www.freecustom.email/api/use-cases/playwright-selenium u can also use our fce ai to figure out how it can integrate with ur setup easily :) |
Beta Was this translation helpful? Give feedback.
-
|
Hi @Julie0713 I've dealt with this exact problem before. Both Mailinator and Guerrilla Mail have the same core issue for automation — Mailinator's free API is essentially abandoned, and Guerrilla Mail silently drops emails from a lot of senders without any error, which makes it maddening to debug. To specifically answer why Guerrilla Mail failed for you — it's not your code. Guerrilla Mail aggressively blocks programmatic access and rate-limits API calls. On top of that, many email providers (especially those sending OTPs) have Guerrilla Mail's domain on a soft-block list, so the email never even arrives at the inbox. There's no bounce, no error — it just disappears, which is why it feels like it "should be working" but isn't. Two options that actually work: Mailslurp is the most reliable for Cypress specifically. It creates a real inbox on the fly and has a const { MailSlurp } = require('mailslurp-client')
const mailslurp = new MailSlurp({ apiKey: Cypress.env('MAILSLURP_API_KEY') })
it('receives OTP', () => {
cy.wrap(mailslurp.createInbox()).then((inbox) => {
cy.get('#email').type(inbox.emailAddress)
cy.get('#submit').click()
cy.wrap(mailslurp.waitForLatestEmail(inbox.id, 30000)).then((email) => {
const otp = email.body.match(/\d{6}/)[0]
cy.get('#otp-input').type(otp)
})
})
})Free tier is 100 emails/month which is plenty for E2E testing. Mailtrap is better if you're on a team or have access to the staging email config. Instead of temp inboxes you just point all outgoing mail to Mailtrap and poll their API: cy.request({
method: 'GET',
url: 'https://mailtrap.io/api/v1/inboxes/{inbox_id}/messages',
headers: { 'Api-Token': Cypress.env('MAILTRAP_API_KEY') }
}).then((response) => {
const otp = response.body[0].text_body.match(/\d{6}/)[0]
cy.get('#otp-input').type(otp)
})If you just need something working quickly, go with Mailslurp — the Cypress integration is straightforward and you'll have it running in under 30 minutes. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I think this will involve API, I already tried mailinator and guerrillamail
but mailinator API seems to be outdated
and guerrillamail is not receiving the email/OTP sent to it
Pls help
Im trying to automate e2e process
Beta Was this translation helpful? Give feedback.
All reactions