Easy-YOPMail v4
  • 💌Easy-YOPMail v4
  • 1️⃣getMail()
  • 2️⃣getInbox()
  • 3️⃣deleteInbox()
  • 4️⃣readMessage()
  • 5️⃣writeMessage()
  • 6️⃣deleteMessage()
Con tecnología de GitBook
En esta página
  • Description:
  • Practical Use:
  • Example Code:
  • Parameters:
  • Error Handling:
  • Limitations:

¿Te fue útil?

deleteMessage()

This feature allows you to delete specific messages.

Description:

The deleteMessage() function of Easy-YOPMail v4 enables developers to delete a specific email from a YOPmail email address based on its unique ID. This feature is particularly useful when you want to selectively clear certain messages from an inbox, especially after identifying specific emails of interest or those that are no longer needed.

Practical Use:

Deleting a specific email from an inbox is beneficial in situations such as:

  • Software Testing: After conducting tests that generate specific email responses, you can use deleteMessage() to remove only those emails that have been processed or are no longer relevant.

  • Data Management: If you've used a temporary email address to receive a variety of emails and only want to keep certain ones for further analysis or action, this function allows for selective deletion.

Example Code:

const easyYOPmail = require('easy-yopmail');

let email = 'sample_email_address';
let messageID = 'unique_message_id'; // Obtained from the inbox

easyYOPmail.deleteMessage(email, messageID).then(response => {
    console.log(response); // Sample output: true (or false if there was an issue deleting the message)
});

Parameters:

The deleteMessage() function requires two parameters:

  • email: The email address from which you want to delete the specific message.

  • id: The unique ID of the email message you wish to delete. This ID is typically obtained from the inbox using the getInbox() function.

Error Handling:

If the email address or message ID does not exist, or there's any other issue while trying to delete the email, the function will return false. Otherwise, upon successful deletion, it will return true. It's essential to handle these outcomes in your code to ensure smooth execution and user feedback.

Limitations:

Once an email is deleted using deleteMessage(), it is permanently removed from the YOPmail application and cannot be retrieved.


AnteriorwriteMessage()

Última actualización hace 1 año

¿Te fue útil?

Do you find this format and content suitable for documentation? If there is anything you would like to improve or add, please let me know.

https://github.com/jasp402/Easy-YOPmail/issues/new/choose
6️⃣
Page cover image