yopmail-helper
v1.0.13
Published
yopmail helper. It will help you receive the mail content.
Maintainers
Readme
yopmail-helper
A lightweight helper for retrieving the latest email from a YOPmail inbox.
📦 Installation
Install via NPM:
npm i yopmail-helperOr via Yarn:
yarn add yopmail-helper🔧 Usage
The library exports a single function: getLatestMailByEmailAddress(emailAddress).
const { getLatestMailByEmailAddress } = require('yopmail-helper');
(async () => {
try {
const email = 'your-yopmail-username'; // Use just the username (e.g., 'admin01')
const latestMail = await getLatestMailByEmailAddress(email);
if (latestMail) {
console.log('Latest Email Found:');
console.log('ID:', latestMail.id);
console.log('Title:', latestMail.title);
console.log('Summary:', latestMail.summary);
console.log('Time:', latestMail.time);
console.log('Body:', latestMail.body);
} else {
console.log('No emails found in this inbox.');
}
} catch (error) {
console.error('Error fetching mail:', error);
}
})();⚙️ Features
- Simple and straightforward API.
- Automatically handles YOPmail's versioning and permission requirements.
- Uses common browser-like headers to reduce scraping issues.
📄 License
MIT
