Selamat datang di proyek Pengelola Tugas! Aplikasi ini memungkinkan pengguna untuk mengelola tugas mereka dan menerima email pengingat untuk tugas yang dijadwalkan pada hari itu. Itu dibangun menggunakan PHP, MySQL, dan PHPMailer.
Kloning repositori :
git clone https://github.com/faezedrx/task-manager-php.git
cd task-manager-php
Instal Dependensi :
composer require phpmailer/phpmailer
Konfigurasi Basis Data :
bamboos1_services_portf.sql
yang disediakan di repositori.config.php
dengan kredensial database Anda.Konfigurasikan Pengaturan Email :
email.php
dengan detail server SMTP Anda. Mulai Aplikasi :
Otentikasi Pengguna :
Kelola Tugas :
Pengingat email ditangani oleh PHPMailer. Pastikan pengaturan SMTP Anda di email.php
dikonfigurasi dengan benar:
<?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 ;
}
}
?>
Kontribusi dipersilakan! Silakan buat permintaan tarik atau buka masalah untuk mendiskusikan perubahan apa pun.
Jika Anda memiliki pertanyaan atau memerlukan bantuan lebih lanjut, jangan ragu untuk menghubungi kami di email saya: [email protected].