HEX
Server: Apache
System: Linux v38079.2is.nl 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: democfellows (10015)
PHP: 8.1.34
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/creativefellows.nl/test.creativefellows.nl/tekenmappen/classes/MailController.php
<?php
	
	/**
	* Description
	*/
	class MailController extends BaseController
	{

		function __construct($settings)
		{
			$this->client_settings = $settings;
		}
		
		public function sendMail($to,$subject,$mail_body,$send_to_master = true)
		{
			if($send_to_master == true) mail($this->getClientSetting("master_email"), $subject, $mail_body, $this->getMailHeaders());
			
			if(mail($to, $subject, $mail_body, $this->getMailHeaders())) return true;
			else return false;
			
			/*
			$mail = new PHPMailer\PHPMailer\PHPMailer();   
			$mail->isSMTP();
			
			$mail->SMTPDebug = 1;
			$mail->CharSet  = 'UTF-8';
			
			$mail->Host = 'mail.creativefellows.nl'; 
			$mail->Port = 587;
			$mail->SMTPSecure = 'tls';
			$mail->SMTPOptions = [
				'ssl' => [
					'verify_peer' => false,
					'verify_peer_name' => false,
					'allow_self_signed' => true
				]
			];
			$mail->SMTPAuth = true;
			$mail->Username = 'test@creativefellows.nl';
			$mail->Password = '2Fjdi24F#qxRbmdt';
			
			$mail->setFrom('verkoop@totaalwarmte.nl', 'Totaalwarmte');
			$mail->addReplyTo('verkoop@totaalwarmte.nl');
			$mail->Subject = $subject;
			$mail->addAddress($to);
			
			$mail->msgHTML($mail_body);
			
			return $mail->send() ? true : false;
			*/
		}
		
		private function getMailHeaders()
		{
			
			$headers  = "From: ". $this->getClientSetting("master_email") ."\n";  
			$headers .= "Reply-To: ". $this->getClientSetting("master_email") ."\n";
			$headers .= "Return-Path: ". $this->getClientSetting("master_email") ."\n";
			$headers .= "Content-type: text/html; charset=UTF-8\n";
			$headers .= "MIME-Version: 1.0\n";
			
			return $headers;
			
		}
	
	}
	
?>