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] 。