basic technique, mail, typescript,

How to receive mail from yopmail in typescript

dani dani Follow Jan 26, 2024 · 1 min read
How to receive mail from yopmail in typescript
Share this

As an automation tester, I want to receive mail from yopmail system. So I can do some feature needed to get information from mail inbox details such as register account or forgot password in an application.

Installation

To receive mail in typescript, I will use the yopmail-helper package. To install that package, I use this command:

npm i yopmail-helper

Yop Mail Helper Sample

How to use

//Declare module
import { inbox, linkOfFirstMail, mailDetails, mailDetailsHtml } from 'yopmail-helper';

✉️ get inbox of a mail address

    const mails = await inbox('admin01');

🗃️ Read details of an email

    const mails = await inbox('admin01');
    const mailDetailsInfo = await mailDetails(mails[0].mailId,'admin01');

🗃️ Read details of an email in HTML

    const mails = await inbox('admin01');
    const mailDetailsHtmlInfo = await mailDetailsHtml(mails[0].mailId,'admin01');
    const link = await linkOfFirstMail('admin01');
dani
Written by dani
Hi, I am Ken. I hope you like it!