<?php

namespace Mailer;

class Mails extends \PHPMailer\PHPMailer\PHPMailer {
  
  

  
  

    // --- Statische Methoden ---
  
  public static function getHost() { 
    
    
    // --- BLOCK: main ---
    return \FOP\Configuration::getMailerMailsHost();
    
  }

  public static function getPort() { 
    
    
    // --- BLOCK: main ---
    return \FOP\Configuration::getMailerMailsPort();
    
  }

  public static function getUser() { 
    
    
    // --- BLOCK: main ---
    return \FOP\Configuration::getMailerMailsUser();
    
  }

  public static function getPassword() { 
    
    
    // --- BLOCK: main ---
    return \FOP\Configuration::getMailerMailsPassword();
    
  }

  public static function getFrom() { 
    
    
    // --- BLOCK: main ---
    return \FOP\Configuration::getMailerMailsFrom();
    
  }

  public static function getFromName() { 
    
    
    // --- BLOCK: main ---
    return \FOP\Configuration::getMailerMailsFromName();
    
  }

  public static function getReplyTo() { 
    
    
    // --- BLOCK: main ---
    return \FOP\Configuration::getMailerMailsReplyTo();
    
  }

  public static function getBcc() { 
    
    
    // --- BLOCK: main ---
    return \FOP\Configuration::getMailerMailsBcc();
    
  }

  public static function getMailer() { 
    
    
    // --- BLOCK: main-create ---
    
	$mail = new self(true);
	$mail->CharSet = 'UTF-8';
	$mail->IsSMTP();
	$mail->Host = self::getHost();
	$mail->Port = self::getPort();
	$mail->SMTPAuth = true;
	$mail->Username = self::getUser();
	$mail->Password = self::getPassword();
	
	if (self::getPort() != 25) $mail->SMTPSecure = 'tls';
	if (self::getPort() == 465) $mail->SMTPSecure = 'ssl';

	$mail->From = self::getFrom();
	$mail->FromName = self::getFromName();
	if (self::getReplyTo()) $mail->addReplyTo(self::getReplyTo());
	if (self::getBcc()) $mail->addBcc(self::getBcc());
    // --- BLOCK: main-return ---
    return $mail;
    
  }


  
  

  
  
}



