<commit_before><?php

    include_once(QFRAMEWORK_CLASS_PATH . "qframework/class/object/qobject.class.php");
    include_once(QFRAMEWORK_CLASS_PATH . "qframework/class/mail/qemailmessage.class.php");
    include_once(QFRAMEWORK_CLASS_PATH . "qframework/libs/phpmailer/class.phpmailer.php");

    define("DEFAULT_EMAIL_SERVICE_TYPE", "php");

    /**
     * @brief Proporciona servicios para enviar emails
     * con la capacidades del nPHP
     * Provides services to send emails via PHPs built-in smtp capabilities.
     *
     * Este servicio tiene dependencias externas segn el mtodo que empleemos
     * para mandar los emails. Existen los siguientes mtodos:
     *
     * - smtp - soporte sockets incluido en el nucleo de PHP
     * - php - soporte mail() que requiere sendmail en Linux, o la configuracin adecuada de php.ini en Windows
     * - sendmail MTA - requiere la configuracin adecuada de este agente
     * - qmail MTA - requiere la configuracin adecuada de este agente
     *
     * Mas informacin:
     * - http://phpmailer.sourceforge.net/
     * - http://es2.php.net/mail
     *
     * @author  qDevel - <EMAIL>
     * @date    22/03/2005 14:13
     * @version 1.0
     * @ingroup net
     */
    class qEmailService extends qObject
    {
        var $_serviceType;

        var $_charset;
        
        var $_smtpHost;
        var $_smtpPort;
        var $_smtpUseAuthentication;
        var $_smtpUser;
        var $_smtpPass;

        var $_customHeaders;

        /**
         * Constructor
         */
        function qEmailService($serviceType = DEFAULT_EMAIL_SERVICE_TYPE, $smtpHost = false, $smtpPort = 25)
        {
            $this->qObject();

            $this->_serviceType           = $serviceType;
            $this->_charset               = "iso-8859-15";
            $this->_smtpHost              = $smtpHost;
            $this->_smtpPort              = $smtpPort;
            $this->_smtpUseAuthentication = false;
            $this->_smtpUser              = false;
            $this->_smtpPass              = false;
            $this->_customHeaders         = array();
        }

        /**
         * Add function info here
         */
        function addCustomHeader($header)
        {
            $this->_customHeaders[] = $header;
        }

        /**
         * Add function info here
         */
        function getCustomHeaders()
        {
            return $this->_customHeaders;
        }
        
        /**
         * Add function info here
         */
        function getCharset()
        {
            return $this->_charset;
        }

        /**
         * Add function info here
         */
        function setCharset($charset)
        {
            $this->_charset = $charset;
        }

        /**
         * Add function info here
         */
        function getServiceType()
        {
            return $this->_serviceType;
        }

        /**
         * Add function info here
         */
        function setServiceType($type)
        {
            $this->_serviceType = $type;
        }

        /**
         * Add function info here
         */
        function getSmtpHost()
        {
            return $this->_smtpHost;
        }

        /**
         * Add function info here
         */
        function setSmtpHost($host)
        {
            $this->_smtpHost = $host;
        }

        /**
         * Add function info here
         */
        function getSmtpPort()
        {
            return $this->_smtpPort;
        }

        /**
         * Add function info here
         */
        function setSmtpPort($port)
        {
            $this->_smtpPort = $port;
        }

        /**
         * Add function info here
         */
        function getSmtpUser()
        {
            return $this->_smtpUser;
        }

        /**
         * Add function info here
         */
        function setSmtpUser($user)
        {
            $this->_smtpUser = $user;
        }

        /**
         * Add function info here
         */
        function getSmtpPass()
        {
            return $this->_smtpPass;
        }

        /**
         * Add function info here
         */
        function setSmtpPass($pass)
        {
            $this->_smtpPass = $pass;
        }

        /**
         * Add function info here
         */
        function setSmtpUseAuthentication($auth, $user = false, $pass = false)
        {
            $this->_smtpUseAuthentication = $auth;
            $this->_smtpUser              = $user;
            $this->_smtpPass              = $<PASSWORD>;
        }

        /**
         * Sends the given message.
         *
         * @param message Object from the EmailMessage class that encapsulates all the different fields
         * an email can have (quite basic, though)
         * @return Returns true if operation was successful or false otherwise.
         */
        function sendMessage(&$message)
        {
            $mail           = new PHPMailer();
            $mail->CharSet  = $this->getCharset();
            $mail->Subject  = $message->getSubject();
            $mail->Body     = $message->getBody();<commit_msg>Minor change. Changed default encoding in email service<commit_after><?php

    include_once(QFRAMEWORK_CLASS_PATH . "qframework/class/object/qobject.class.php");
    include_once(QFRAMEWORK_CLASS_PATH . "qframework/class/mail/qemailmessage.class.php");
    include_once(QFRAMEWORK_CLASS_PATH . "qframework/libs/phpmailer/class.phpmailer.php");

    define("DEFAULT_EMAIL_SERVICE_TYPE", "php");

    /**
     * @brief Proporciona servicios para enviar emails
     * con la capacidades del nPHP
     * Provides services to send emails via PHPs built-in smtp capabilities.
     *
     * Este servicio tiene dependencias externas segn el mtodo que empleemos
     * para mandar los emails. Existen los siguientes mtodos:
     *
     * - smtp - soporte sockets incluido en el nucleo de PHP
     * - php - soporte mail() que requiere sendmail en Linux, o la configuracin adecuada de php.ini en Windows
     * - sendmail MTA - requiere la configuracin adecuada de este agente
     * - qmail MTA - requiere la configuracin adecuada de este agente
     *
     * Mas informacin:
     * - http://phpmailer.sourceforge.net/
     * - http://es2.php.net/mail
     *
     * @author  qDevel - <EMAIL>
     * @date    22/03/2005 14:13
     * @version 1.0
     * @ingroup net
     */
    class qEmailService extends qObject
    {
        var $_serviceType;

        var $_charset;
        
        var $_smtpHost;
        var $_smtpPort;
        var $_smtpUseAuthentication;
        var $_smtpUser;
        var $_smtpPass;

        var $_customHeaders;

        /**
         * Constructor
         */
        function qEmailService($serviceType = DEFAULT_EMAIL_SERVICE_TYPE, $smtpHost = false, $smtpPort = 25)
        {
            $this->qObject();

            $this->_serviceType           = $serviceType;
            $this->_charset               = "iso-8859-15";
            $this->_smtpHost              = $smtpHost;
            $this->_smtpPort              = $smtpPort;
            $this->_smtpUseAuthentication = false;
            $this->_smtpUser              = false;
            $this->_smtpPass              = <PASSWORD>;
            $this->_customHeaders         = array();
        }

        /**
         * Add function info here
         */
        function addCustomHeader($header)
        {
            $this->_customHeaders[] = $header;
        }

        /**
         * Add function info here
         */
        function getCustomHeaders()
        {
            return $this->_customHeaders;
        }
        
        /**
         * Add function info here
         */
        function getCharset()
        {
            return $this->_charset;
        }

        /**
         * Add function info here
         */
        function setCharset($charset)
        {
            $this->_charset = $charset;
        }

        /**
         * Add function info here
         */
        function getServiceType()
        {
            return $this->_serviceType;
        }

        /**
         * Add function info here
         */
        function setServiceType($type)
        {
            $this->_serviceType = $type;
        }

        /**
         * Add function info here
         */
        function getSmtpHost()
        {
            return $this->_smtpHost;
        }

        /**
         * Add function info here
         */
        function setSmtpHost($host)
        {
            $this->_smtpHost = $host;
        }

        /**
         * Add function info here
         */
        function getSmtpPort()
        {
            return $this->_smtpPort;
        }

        /**
         * Add function info here
         */
        function setSmtpPort($port)
        {
            $this->_smtpPort = $port;
        }

        /**
         * Add function info here
         */
        function getSmtpUser()
        {
            return $this->_smtpUser;
        }

        /**
         * Add function info here
         */
        function setSmtpUser($user)
        {
            $this->_smtpUser = $user;
        }

        /**
         * Add function info here
         */
        function getSmtpPass()
        {
            return $this->_smtpPass;
        }

        /**
         * Add function info here
         */
        function setSmtpPass($pass)
        {
            $this->_smtpPass = $pass;
        }

        /**
         * Add function info here
         */
        function setSmtpUseAuthentication($auth, $user = false, $pass = false)
        {
            $this->_smtpUseAuthentication = $auth;
            $this->_smtpUser              = $user;
            $this->_smtpPass              = $pass;
        }

        /**
         * Sends the given message.
         *
         * @param message Object from the EmailMessage class that encapsulates all the different fields
         * an email can have (quite basic, though)
         * @return Returns true if operation was successful or false otherwise.
         */
        function sendMessage(&$message)
        {
            $mail           = new PHPMailer();
            $mail->Encoding = "quoted-printable";
            $mail->CharSet  = $this->getCharset();
            $mail->Subject  = $message->getSubject();
            $mail->Body     = $message->getBody();
{'fraction_non_alphanumeric': 0.10024026910139357, 'fraction_numerical': 0.004420951465641519, 'mean_word_length': 1.3542986425339367, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 72, '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': '4132230', 'n_tokens_mistral': 2959, 'n_tokens_neox': 2821, 'n_words': 654}