Welcome to the Task Manager project! This application allows users to manage their tasks and receive email reminders for tasks scheduled for the day. It's built using PHP, MySQL, and PHPMailer.
- 📝 Add, Edit, and Delete Tasks: Manage your tasks effortlessly.
- 📅 Email Reminders: Receive email reminders for tasks scheduled for the current day.
- 🔒 User Authentication: Secure login to manage your tasks.
- 📧 Immediate Email Notifications: Send immediate email reminders for tasks on a selected date.
-
Clone the repository:
git clone https://github.com/faezedrx/task-manager-php.git cd task-manager-php
-
Install Dependencies:
- Download and include PHPMailer:
composer require phpmailer/phpmailer
- Download and include PHPMailer:
-
Configure Database:
- Create a database and import the
bamboos1_services_portf.sql
file provided in the repository. - Update the
config.php
file with your database credentials.
- Create a database and import the
-
Configure Email Settings:
- Update the
email.php
file with your SMTP server details.
- Update the
-
Start the Application:
- Deploy the application on a local server or any web hosting service.
- Access the application through your browser.
-
User Authentication:
- Register a new user or login with an existing account.
-
Manage Tasks:
- Add new tasks with a specific date.
- Edit or delete existing tasks.
- Receive daily email reminders for the tasks scheduled for today.
The email reminders are handled by PHPMailer. Ensure that your SMTP settings in email.php
are correctly configured:
<?php
require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
// require 'vendor/autoload.php';
class Mail {
private static $instance = null;
private $mail;
private function __construct() {
$this->mail = new PHPMailer(true);
$this->configureSMTP();
}
private function configureSMTP() {
// تنظیمات سرور SMTP
$this->mail->isSMTP();
$this->mail->Host = 'your-smtp-server';
$this->mail->SMTPAuth = true;
$this->mail->Username = '[email protected]';
$this->mail->Password = 'your-email-password';
$this->mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$this->mail->Port = 587;
}
public static function getInstance() {
if (self::$instance == null) {
self::$instance = new Mail();
}
return self::$instance;
}
public function getMailer() {
return $this->mail;
}
}
function sendEmail($to, $subject, $body) {
$mailInstance = Mail::getInstance()->getMailer();
try {
// تنظیمات گیرنده
$mailInstance->setFrom('[email protected]', 'Task Management');
$mailInstance->addAddress($to);
// تنظیمات محتوا
$mailInstance->isHTML(true);
$mailInstance->Subject = $subject;
$mailInstance->Body = $body;
// ارسال ایمیل
$mailInstance->send();
return true;
} catch (Exception $e) {
error_log("Email could not be sent. Mailer Error: {$mailInstance->ErrorInfo}");
return false;
}
}
?>
Contributions are welcome! Please create a pull request or open an issue to discuss any changes.
- PHPMailer for handling the email functionality.
- Tailwind CSS for styling the application.
- SweetAlert2 for beautiful alerts.
If you have any questions or need further assistance, feel free to contact us at my email : [email protected] .