Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
update mod PHPMailer php7.4
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods Requests

2024-04-01 08:45:15
REQ this mod
https://github.com/PHPMailer/PHPMailer/releases
2024-04-04 03:27:48
this maybe has potential. Its not complete, but thats why I post it here, for help making it better or working. From what i can work out, you need what is in the SRC folder. Unpack those files to your backend/ folder.  You can see the path in the first few lines of code. Then you have to get OAUTH2 shit from google. You will have to google that if you dont know what I mean. Here is the phpmailer https://github.com/PHPMailer/PHPMailer
and here is what I was trying to do. Maybe community help will work to make this work.
BACKUP all files before testing anything. It would be fun to get this working, but I havent had time to play.
backend/mail.php
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\OAuth;


$GLOBALS["TTMail"] = new TTMail;

class TTMail {
   var $type;

   var $smtp_host;
   var $smtp_port = 465; // Update to Gmail's SMTP port for TLS
   var $smtp_ssl = false;
   var $smtp_auth = true;
   var $smtp_user;
   var $smtp_pass;
   var $oauth2_client_id; // Add OAuth2 client ID
   var $oauth2_client_secret; // Add OAuth2 client secret
   var $oauth2_refresh_token; // Add OAuth2 refresh token

   function __construct() {
       GLOBAL $site_config;

       switch (strtolower($site_config["mail_type"])) {
           case "phpmailer":
               $this->type = "phpmailer";
               $this->smtp_host = 'smtp.gmail.com';
               $this->smtp_port = 465;
               $this->smtp_auth = true;
               $this->smtp_user = $site_config["mail_smtp_user"];
               $this->smtp_pass = $site_config["mail_smtp_pass"];

               // Add OAuth2 settings
               $this->oauth2_client_id = $site_config["oauth2_client_id"];
               $this->oauth2_client_secret = $site_config["oauth2_client_secret"];
               $this->oauth2_refresh_token = $site_config["oauth2_refresh_token"];

               // Enable TLS
               $this->smtp_ssl = 'tls';
               break;

           case "pear":
               $this->type = "pear";
               $this->smtp_ssl = $site_config["mail_smtp_ssl"];

               if ($this->smtp_ssl) {
                   $this->smtp_host = "ssl://" . $site_config["mail_smtp_host"];
               } else {
                   $this->smtp_host = $site_config["mail_smtp_host"];
               }

               $this->smtp_port = $site_config["mail_smtp_port"];
               $this->smtp_auth = $site_config["mail_smtp_auth"];
               $this->smtp_user = $site_config["mail_smtp_user"];
               $this->smtp_pass = $site_config["mail_smtp_pass"];

               if (!@include_once("Mail.php")) {
                   trigger_error("Config is set to use PEAR Mail but it is not installed (or include_path is wrong).", E_USER_WARNING);
                   $this->type = "php";
               }
               break;

           case "php":
           default:
               $this->type = "php";
       }
   }

   function Send($to, $subject, $message, $additional_headers = "", $additional_parameters = "") {
       GLOBAL $site_config;

       if (preg_match("!^From:(.*)!m", $additional_headers, $matches)) {
           $from = trim($matches[1]);
       } else {
           $from = "$site_config[SITEEMAIL]";
       }

       $additional_headers = preg_replace("!^From:(.*)!m", "", $additional_headers);
       $additional_headers .= "\nFrom: $from\nReturn-Path: $from";
       $additional_headers = trim($additional_headers);
       $additional_headers = preg_replace("!\n+!", "\n", $additional_headers);

       switch ($this->type) {
           case "phpmailer":
               $mail = new PHPMailer(true);
               $mail->isSMTP();
               $mail->Host = $this->smtp_host;
               $mail->Port = $this->smtp_port;
               $mail->SMTPAuth = $this->smtp_auth;
               $mail->Username = $this->smtp_user;
               $mail->Password = $this->smtp_pass;

               // Add OAuth2 settings
               $mail->OAuth2ClientId = $this->oauth2_client_id;
               $mail->OAuth2ClientSecret = $this->oauth2_client_secret;
               $mail->OAuth2RefreshToken = $this->oauth2_refresh_token;

               $mail->SMTPSecure = $this->smtp_ssl;

               $mail->setFrom($from);
               $mail->addAddress($to);
               $mail->Subject = $subject;
               $mail->Body = $message;

               try {
                   $mail->send();
               } catch (Exception $e) {
                   echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
               }
               break;

           case "pear":
               $headers = array("From" => $from, "Return-Path" => $from, "To" => $to, "Subject" => $subject);
               $params = array("host" => $this->smtp_host, "port" => $this->smtp_port, "auth" => $this->smtp_auth, "username" => $this->smtp_user, "password" => $this->smtp_pass);
               $smtp = Mail::Factory("smtp", $params);

               $mail = $smtp->send($to, $headers, $message);
               break;

           case "php":
           default:
               @mail($to, $subject, $message, $additional_headers, $additional_parameters);
               break;
       }
   }
}

function sendmail($to, $subject, $message, $additional_headers = "", $additional_parameters = "") {
   GLOBAL $TTMail;
   $TTMail->Send($to, $subject, $message, $additional_headers, $additional_parameters);
}
?>

config would be
// BELOW IS SETTINGS FOR OAUTH2 GMAIL. NEED OAUTH2 KEY (see code in mail.php)
// $site_config["mail_type"] = "phpmailer";
// $site_config["mail_smtp_host"] = "smtp.gmail.com"; // SMTP server hostname
// $site_config["mail_smtp_port"] = "465"; // SMTP server port
// $site_config["mail_smtp_ssl"] = true; // true to use SSL (ONLY USED WITH PEAR. Is not used with phpmailer)
// $site_config["mail_smtp_auth"] = true; // MUST BE true to use auth for SMTP (JUST LEAVE SET TO TRUE)
// $site_config["mail_smtp_user"] = "person@gmail.com"; // SMTP username
// $site_config["mail_smtp_pass"] = "Password"; // SMTP password
// $site_config["oauth2_client_id"] = "CLIENT ID HERE"; // OAUTH2 keys from google to use gmail shit
// $site_config["oauth2_client_secret"] = "SECRET KEY HERE";
// $site_config["oauth2_refresh_token"] = ""; //Im not sure how to get this yet.

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2024-04-04 03:41:46
2024-04-12 07:45:05
blank page  
when make order

i try with local mail
2025-02-27 16:33:50
pro.turbo-smtp.com
best smtp ever free
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728