diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-03-31 05:49:40 +0300 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-03-31 05:49:40 +0300 |
| commit | c95daba5206cb4bd55b5685e8141311f23606e1a (patch) | |
| tree | dcf3ab236cbf60c4d2ffc8af9a520804f504a437 /html/app/controllers/Auth.php | |
| parent | 4f2d900af7636e6744ae14aeeefdf2d6080ac50a (diff) | |
| download | classroom-c95daba5206cb4bd55b5685e8141311f23606e1a.tar.gz classroom-c95daba5206cb4bd55b5685e8141311f23606e1a.tar.bz2 classroom-c95daba5206cb4bd55b5685e8141311f23606e1a.zip | |
added advances and secure confifuratin parametres
Diffstat (limited to 'html/app/controllers/Auth.php')
| -rw-r--r-- | html/app/controllers/Auth.php | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/html/app/controllers/Auth.php b/html/app/controllers/Auth.php index d0462e2..6c3eadc 100644 --- a/html/app/controllers/Auth.php +++ b/html/app/controllers/Auth.php @@ -127,11 +127,29 @@ class Auth { private static function mail_activationCode($letter) { $mail = new PHPMailer(); + + // setup smpt + $mail->SMTPDebug = 2; + $mail->IsSMTP(); + $mail->Host = MAIL_HOST; + $mail->SMPTAuth = true; + $mail->SMTPSecure = MAIL_ENCRYPTION; + $mail->Protocol = 'mail'; + + $mail->Mailer = MAIL_MAILER; + $mail->Port = MAIL_PORT; + $mail->Username = MAIL_USERNAME; + $mail->Password = MAIL_PASSWORD; + + // setup format $mail->CharSet = 'utf-8'; $mail->IsHTML(true); - //It's important not to use the submitter's address as the from address as it's forgery, - //which will cause your messages to fail SPF checks. - //Use an address in your own domain as the from address, put the submitter's address in a reply-to + + // setup THE mail + // --- -- -- - - - + // It's important not to use the submitter's address as the from address as it's forgery, + // which will cause your messages to fail SPF checks. + // Use an address in your own domain as the from address, put the submitter's address in a reply-to $mail->setFrom(NO_REPLY_EMAIL, SITE_TITLE); $mail->addAddress($letter['email'], $letter['name']); $mail->addReplyTo(REPLY_TO_EMAIL, SITE_TITLE); @@ -277,3 +295,5 @@ class Auth { } +// NOTE: +// check: https://netcorecloud.com/tutorials/send-an-email-via-gmail-smtp-server-using-php/
\ No newline at end of file |
