This is a console-based Email Management System implemented in C++ that simulates the core functionalities of an email platform. Users can create accounts, send emails, save drafts, move emails to trash or spam, and persist data across sessions using file I/O.
-
👤 Account Management
- Create new user accounts
- Login with email and password
- Validates unique usernames and emails
- Supports email domain verification (
lhr.nu.edu.pk
)
-
📥 Inbox
- View received emails
- Move emails to trash
-
📤 Sent Mail
- View sent messages
-
📝 Drafts
- Save unfinished emails
- Send saved drafts later
-
🚫 Spam
- Automatically detects and filters spam using predefined keywords
- Move spam emails to trash
-
🗑️ Trash
- View and manage deleted or spammed emails
-
💾 Persistence
- Save and load all user data and emails to/from a file (
accounts.txt
) - Automatically backs up existing data before overwrite
- Save and load all user data and emails to/from a file (
Emails are flagged as spam if they contain any of the following keywords:
Winner, Free, Urgent, Claim, Bonus, Limited,
Exclusive, Gift, Guaranteed, Profit
email2.cpp
: Contains the complete codebase including templates forMail
,MailList
,Account
, andAccountList
.accounts.txt
: Used for saving and loading all email and account data (auto-managed by the system).
-
Compile the Code:
g++ -o email_system EmailManagementSystem.cpp
-
Run the Program:
./email_system
-
Choose from Menu:
- Create a new account
- Login to an existing account
- Use sub-menu to manage emails
- C++11 or later
- Standard C++ Libraries (
<iostream>
,<fstream>
,<string>
)
Mail<T>
: Stores individual email informationMailList<T>
: Manages a linked list of emails (Inbox, Drafts, etc.)Account<T>
: Holds all user details and related mailboxesAccountList<T>
: Manages all registered accounts and handles file operations
- Email addresses must belong to the domain
lhr.nu.edu.pk
- Password must be at least 6 characters long
- The program uses templates and dynamic memory allocation extensively
- Improper program termination may cause data loss unless explicitly saved
✅ Add a graphical user interface (GUI) using libraries like Qt or SFML
✅ Enable password encryption for security
✅ Support for attachments and multimedia content
✅ Implement search and filter functionalities for emails
✅ Add "Mark as Read/Unread" feature
✅ Improve spam detection using NLP or machine learning
✅ Add email reply and forward functionalities
✅ Implement pagination for large inboxes
✅ Add scheduled email sending and notifications
✅ Enable multiple account sessions
This project was built as part of a course assignment or learning module involving OOP and file handling in C++.
We welcome contributions from the open-source community. If you'd like to collaborate on this project, please adhere to the following guidelines:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Implement your changes and commit them with descriptive messages.
- Push your branch to your fork and submit a pull request.