Using this library, you can create a random temporary Gmail and receive messages.
pip install -U GmailBox
from GmailBox import GmailBox
Gmail = GmailBox()
New_Gmail = Gmail.new_email() email = New_Gmail.email print(email)
inbox = Gmail.inbox(email)
if inbox: for message in inbox: print("=" 21) print(message) print("=" 21)
else: print(f' [!] No messages were received.')
- Here an async example:
```python
from GmailBox.asyncio import GmailBox
import asyncio
# Define the main function
async def main():
Gmail = GmailBox()
# Create a new gmail
New_Gmail = await Gmail.new_email()
email = New_Gmail.email
print(email)
# Start checking the inbox
inbox = await Gmail.inbox(email)
# If there are messages in the inbox, print them
if inbox:
for message in inbox:
print("=" * 21)
print(message)
print("=" * 21)
# If no messages were received, print a message
else:
print(f' [!] No messages were received.')
# Run the main function
asyncio.run(main())