<commit_before><?php
namespace luya\components;

class Mailer extends \yii\base\Component
{
    public $phpmailer = null;

    public $isSMTP = null;

    public $host = null; //'mail.yourserver.com';

    public $username = null; //'<EMAIL>';

    public $password = null; //'PASSWORD';

    public function create()
    {
        $this->phpmailer = new \PHPMailer();
        
        if ($this->host === null) {
            $this->host = \yii::$app->getModule('luya')->mailerHost;
        }
        
        if ($this->username === null) {
            $this->host = \yii::$app->getModule('luya')->mailerUsername;
        }
        
        if ($this->password === null) {
            $this->password = \yii::$app->getModule('luya')->mailerPassword;
        }
        
        if ($this->isSMTP === null) {
            $this->isSMTP = \yii::$app->getModule('luya')->mailerIsSMTP;
        }
        
        if ($this->isSMTP) {
            $this->phpmailer->SMTPDebug = 2;
            $this->phpmailer->isSMTP();
            $this->phpmailer->Host = $this->host;
            $this->phpmailer->Username = $this->username;
            $this->phpmailer->Password = $<PASSWORD>;
            $this->phpmailer->Port = 587;
            $this->phpmailer->SMTPSecure = 'tls';
            $this->phpmailer->SMTPAuth = true;
        }
        $this->phpmailer->From = '<EMAIL>';
        $this->phpmailer->FromName = '<EMAIL>';
        $this->phpmailer->isHTML(true);
        $this->phpmailer->AltBody = 'Please use a HTML compatible E-Mail-Client to read this E-Mail.';
    }
    
    public function compose($subject, $body)
    {
        $this->cleanup();
        $this->create();<commit_msg>php mailer tls/ssl port issue [in progress]<commit_after><?php
namespace luya\components;

class Mailer extends \yii\base\Component
{
    public $phpmailer = null;

    public $isSMTP = null;

    public $host = null; //'mail.yourserver.com';

    public $username = null; //'<EMAIL>';

    public $password = null; //'PASSWORD';

    public $portSMTP = null;
    
    public function create()
    {
        $this->phpmailer = new \PHPMailer();
        
        if ($this->host === null) {
            $this->host = \yii::$app->getModule('luya')->mailerHost;
        }
        
        if ($this->username === null) {
            $this->username = \yii::$app->getModule('luya')->mailerUsername;
        }
        
        if ($this->password === null) {
            $this->password = \yii::$app->getModule('luya')->mailerPassword;
        }
        
        if ($this->isSMTP === null) {
            $this->isSMTP = \yii::$app->getModule('luya')->mailerIsSMTP;
        }
        
        if ($this->isSMTP) {
            
            $this->phpmailer->SMTPOptions = array(
                'ssl' => array(
                    'verify_peer' => false,
                    'verify_peer_name' => false,
                    'allow_self_signed' => true
                )
            );
            $this->phpmailer->SMTPDebug = 4;
            $this->phpmailer->isSMTP();
            $this->phpmailer->Host = $this->host;
            $this->phpmailer->SMTPSecure = 'tls';
            $this->phpmailer->SMTPAuth = true;
            $this->phpmailer->Username = $this->username;
            $this->phpmailer->Password = $<PASSWORD>;
            $this->phpmailer->Port = 587;
        }
        $this->phpmailer->From = '<EMAIL>';
        $this->phpmailer->FromName = '<EMAIL>';
        $this->phpmailer->isHTML(true);
        $this->phpmailer->AltBody = 'Please use a HTML compatible E-Mail-Client to read this E-Mail.';
    }
    
    public function compose($subject, $body)
    {
        $this->cleanup();
        $this->create();
{'fraction_non_alphanumeric': 0.17188343227199138, 'fraction_numerical': 0.0021586616297895305, 'mean_word_length': 1.8319327731092436, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 109, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '484949', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1193, 'n_words': 198}