Willkommen beim Task-Manager-Projekt! Mit dieser Anwendung können Benutzer ihre Aufgaben verwalten und E-Mail-Erinnerungen für für den Tag geplante Aufgaben erhalten. Es wurde mit PHP, MySQL und PHPMailer erstellt.
Klonen Sie das Repository :
git clone https://github.com/faezedrx/task-manager-php.git
cd task-manager-php
Abhängigkeiten installieren :
composer require phpmailer/phpmailer
Datenbank konfigurieren :
bamboos1_services_portf.sql
.config.php
mit Ihren Datenbankanmeldeinformationen.E-Mail-Einstellungen konfigurieren :
email.php
mit Ihren SMTP-Serverdetails. Starten Sie die Anwendung :
Benutzerauthentifizierung :
Aufgaben verwalten :
Die E-Mail-Erinnerungen werden von PHPMailer verwaltet. Stellen Sie sicher, dass Ihre SMTP-Einstellungen in email.php
korrekt konfiguriert sind:
<?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 ;
}
}
?>
Beiträge sind willkommen! Bitte erstellen Sie eine Pull-Anfrage oder öffnen Sie ein Problem, um etwaige Änderungen zu besprechen.
Wenn Sie Fragen haben oder weitere Hilfe benötigen, können Sie uns gerne unter meiner E-Mail-Adresse kontaktieren: [email protected].