task manager php
1.0.0
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.
Clone the repository:
git clone https://github.com/faezedrx/task-manager-php.git
cd task-manager-phpInstall Dependencies:
composer require phpmailer/phpmailerConfigure Database:
bamboos1_services_portf.sql file provided in the repository.config.php file with your database credentials.Configure Email Settings:
email.php file with your SMTP server details.Start the Application:
User Authentication:
Manage Tasks:
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 PHPMailerPHPMailerPHPMailer;
use PHPMailerPHPMailerException;
// 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.
If you have any questions or need further assistance, feel free to contact us at my email : [email protected] .