Bem-vindo ao projeto Gerenciador de Tarefas! Este aplicativo permite aos usuários gerenciar suas tarefas e receber lembretes por e-mail das tarefas agendadas para o dia. É construído usando PHP, MySQL e PHPMailer.
Clone o repositório :
git clone https://github.com/faezedrx/task-manager-php.git
cd task-manager-php
Instalar dependências :
composer require phpmailer/phpmailer
Configurar banco de dados :
bamboos1_services_portf.sql
fornecido no repositório.config.php
com as credenciais do seu banco de dados.Definir configurações de e-mail :
email.php
com os detalhes do seu servidor SMTP. Inicie o aplicativo :
Autenticação do usuário :
Gerenciar tarefas :
Os lembretes por e-mail são gerenciados pelo PHPMailer. Certifique-se de que suas configurações de SMTP em email.php
estejam configuradas corretamente:
<?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 ;
}
}
?>
Contribuições são bem-vindas! Crie uma solicitação pull ou abra um problema para discutir quaisquer alterações.
Se você tiver alguma dúvida ou precisar de mais assistência, não hesite em nos contatar pelo meu e-mail: [email protected].