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/recht.creativefellows.nl/src/Domain/Mail/FormMailer.php
<?php

namespace App\Domain\Mail;

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
use Psr\Container\ContainerInterface;



/**
 * FormMailer Service
 */
final class FormMailer
{

    private $container;	
	private $mailer;

    public function __construct(
		ContainerInterface $container,
		PHPMailer $mailer
	){
        $this->container = $container;
        $this->mailer = $mailer;		
		
		$this->mailer->SMTPDebug = 0;
		$this->mailer->isHTML(true);   														  
		
	}
	
    public function body(string $body)
    {	
		$this->mailer->Body = $body;	
    }
	
	public function subject(string $subject)
	{
		$this->mailer->Subject = $subject;
	}
	
	public function from(array $sender)
	{
		$this->mailer->setFrom($sender["email"], $sender["name"]);
	}
	
	public function to(array $receivers)
	{	
		foreach($receivers as $user)
		{
			$this->mailer->addAddress($user);
		}
	}
	
	
	public function send()
	{
		return $this->mailer->send();
	}
	
		
	
}