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
بتفاصيل خادم SMTP الخاص بك. ابدأ التطبيق :
مصادقة المستخدم :
إدارة المهام :
يتم التعامل مع تذكيرات البريد الإلكتروني بواسطة PHPMailer. تأكد من تكوين إعدادات SMTP في email.php
بشكل صحيح:
<?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].