How to use the command 'tmpmail' (with examples)

How to use the command 'tmpmail' (with examples)

The ’tmpmail’ command is a tool that allows you to create temporary email addresses and manage the received emails, all directly from your terminal. It is written in POSIX sh, making it compatible with various operating systems. With ’tmpmail’, you can easily generate temporary inboxes, view the list of messages, open specific messages, and more.

Use case 1: Create a temporary inbox

Code:

tmpmail --generate

Motivation: Creating a temporary inbox can be useful when you need to sign up for online services or platforms that require an email address verification. By generating a temporary inbox, you can receive the verification email without exposing your personal email address.

Explanation: The ‘–generate’ argument instructs ’tmpmail’ to create a temporary inbox.

Example output:

Generated temporary inbox: sdf293sadf@tmpmail.org

Use case 2: List messages and their numeric ID

Code:

tmpmail

Motivation: Being able to list the messages and their numeric IDs allows you to have an overview of the emails you have received in your temporary inbox. It helps you identify specific emails when you need to perform further actions on them.

Explanation: The command ’tmpmail’ without any arguments lists all the received messages along with their numeric IDs.

Example output:

1. From: example@email.com, Subject: Greetings!
2. From: newsletter@mail.com, Subject: Exclusive offers!

Use case 3: Display the most recent received email

Code:

tmpmail --recent

Motivation: When you want to quickly check the latest email you have received in your temporary inbox, using the ‘–recent’ argument can save you time. It avoids the need to manually search for the appropriate email ID.

Explanation: The ‘–recent’ argument tells ’tmpmail’ to display the most recent received email.

Example output:

From: newsletter@mail.com
To: sdf293sadf@tmpmail.org
Subject: Exclusive offers!

Dear user,

We are excited to offer you exclusive deals and discounts...

Use case 4: Open a specific message

Code:

tmpmail email_id

Motivation: Sometimes, you may need to open a specific email to read its content or view its attachments. By providing the email ID, you can directly access the email you want to open.

Explanation: Replace ’email_id’ in the command with the numeric ID of the email you want to open. ’tmpmail’ will display the content of that specific email.

Example output:

From: example@email.com
To: sdf293sadf@tmpmail.org
Subject: Greetings!

Hello,

Just wanted to say hi and see how you're doing...

Use case 5: View email as raw text without HTML tags

Code:

tmpmail --text

Motivation: If you prefer to read emails without the distraction of HTML formatting and tags, using the ‘–text’ argument will display the email content as raw text. It provides a cleaner and more focused reading experience.

Explanation: The ‘–text’ argument instructs ’tmpmail’ to display the email content without HTML tags.

Example output:

From: example@email.com
To: sdf293sadf@tmpmail.org
Subject: Greetings!

Hello,

Just wanted to say hi and see how you're doing...

Use case 6: Open email with a specific browser

Code:

tmpmail --browser browser

Motivation: By default, ’tmpmail’ opens the email using the w3m browser. However, if you prefer to use a different browser, you can specify it using the ‘–browser’ argument. This allows you to view the email in the browser you are most comfortable with.

Explanation: Replace ‘browser’ in the command with the desired browser name to open the email. The specified browser will be used to display the email.

Example output:

Email opens in the specified browser.

Conclusion:

The ’tmpmail’ command offers great convenience for managing temporary emails directly from your terminal. You can easily generate temporary inboxes, view and open received emails, and even customize the browser used for viewing emails. With these use cases and its POSIX sh compatibility, ’tmpmail’ becomes a valuable tool to handle temporary email communication efficiently.

Related Posts

How to use the command 'resolveip' (with examples)

How to use the command 'resolveip' (with examples)

The ‘resolveip’ command is a useful tool for resolving hostnames to their IP addresses and vice versa.

Read More
How to use the command 'udisksctl' (with examples)

How to use the command 'udisksctl' (with examples)

The ‘udisksctl’ command is used to interact with the ‘udisksd’ daemon, allowing users to query and manipulate storage devices.

Read More
How to use the command ppmtowinicon (with examples)

How to use the command ppmtowinicon (with examples)

The command ppmtowinicon is a command line tool that is used to convert a Portable Pixmap (PPM) image to a Windows Icon (ICO) image.

Read More