task manager php
1.0.0
歡迎來到任務管理器專案!該應用程式允許用戶管理他們的任務並接收當天安排的任務的電子郵件提醒。它是使用 PHP、MySQL 和 PHPMailer 建構的。
克隆儲存庫:
git clone https://github.com/faezedrx/task-manager-php.git
cd task-manager-php
安裝依賴項:
composer require phpmailer/phpmailer
配置資料庫:
bamboos1_services_portf.sql
檔案。config.php
檔案。配置電子郵件設定:
email.php
檔案。 啟動應用程式:
用戶認證:
管理任務:
電子郵件提醒由 PHPMailer 處理。確保email.php
中的 SMTP 設定正確配置:
<?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 ;
}
}
?>
歡迎貢獻!請建立拉取請求或開啟問題來討論任何變更。
如果您有任何疑問或需要進一步協助,請隨時透過我的電子郵件與我們聯繫:[email protected]。