src/OwpMessaging.inc.php
private function sendCore($data_array, $smtp_hostname)
    {

        try {
            $this->validateData($data_array);
        } catch (InvalidArgumentException $e) {
            throw new InvalidArgumentException("OwpMessaging->sendCore(): Caught InvalidArgumentException: ".$e->getMessage());
        }

        $email_to_clean = filter_var($data_array["email_to"], FILTER_SANITIZE_EMAIL);

        $mail = new PHPMailer;

        $mail->isSMTP();
        $mail->Host = $smtp_hostname;

        if(in_array(getenv("smtp_auth"), array("yes", "true", 1))) {
            $mail->SMTPAuth = true;
            $mail->Username = (string) getenv("smtp_username");
            $mail->Password = (string) getenv("smtp_password");
        }

        if(in_array(getenv("smtp_secure"), array("ssl", "tls"))) {
            $mail->SMTPSecure  = (string) getenv("smtp_secure");
            $mail->SMTPOptions = array(
                                  'ssl' => array(
                                            'verify_peer'       => false,
                                            'allow_self_signed' => true,
                                            'verify_peer_name'  => false,
                                            'cafile'            => '/etc/ssl/ca_cert.pem',
                                           ),
                                 );
        }

        $mail->Port = (string) getenv("smtp_port");

        $mail->XMailer  = "OpenWebPresence-1.0";
        $mail->Helo     = gethostname();
        $mail->Hostname = gethostname();

        $mail->From     = $data_array["email_from"];
        $mail->FromName = $data_array["email_from_name"];
        $mail->AddAddress($email_to_clean, $data_array["email_to_name"]);
        // $mail->AddReplyTo(filter_var($data_array["reply_to"], FILTER_SANITIZE_EMAIL));
        if(in_array(getenv("DKIM_active"), array("yes", "true", 1))) {
            $mail->DKIM_domain     = getenv("DKIM_domain");
            $mail->DKIM_private    = $this->root_path.'PHPMailer_DKIM/'.getenv("DKIM_private").'.htkeyprivate';
            $mail->DKIM_selector   = getenv("DKIM_selector");
            $mail->DKIM_passphrase = getenv("DKIM_passphrase");
            $mail->DKIM_identity   = getenv("DKIM_identity");
        }

        $mail->WordWrap = 50;
        $mail->IsHTML(true);

        $mail->Subject = $data_array["subject"];
        $mail->Body    = $data_array["message_body"];

        $mail->addCustomHeader("X-AntiAbuse", "This is a solicited email for ".$data_array["sender_domain"].".");
        $mail->addCustomHeader("X-AntiAbuse", $data_array["email_from"]);

        if(!$mail->send()) {
            throw new Exception($mail->ErrorInfo);
        } else {
            return true;
        }

    }
private function sendCore($data_array, $smtp_hostname)
    {

        try {
            $this->validateData($data_array);
        } catch (InvalidArgumentException $e) {
            throw new InvalidArgumentException("OwpMessaging->sendCore(): Caught InvalidArgumentException: ".$e->getMessage());
        }

        $email_to_clean = filter_var($data_array["email_to"], FILTER_SANITIZE_EMAIL);

        $mail = new PHPMailer;

        $mail->isSMTP();
        $mail->Host = $smtp_hostname;

        if(in_array(getenv("smtp_auth"), array("yes", "true", 1))) {
            $mail->SMTPAuth = true;
            $mail->Username = (string) getenv("smtp_username");
            $mail->Password = (string) getenv("smtp_password");
        }

        if(in_array(getenv("smtp_secure"), array("ssl", "tls"))) {
            $mail->SMTPSecure  = (string) getenv("smtp_secure");
            $mail->SMTPOptions = array(
                                  'ssl' => array(
                                            'verify_peer'       => false,
                                            'allow_self_signed' => true,
                                            'verify_peer_name'  => false,
                                            'cafile'            => '/etc/ssl/ca_cert.pem',
                                           ),
                                 );
        }

        $mail->Port = (string) getenv("smtp_port");

        $mail->XMailer  = "OpenWebPresence-1.0";
        $mail->Helo     = gethostname();
        $mail->Hostname = gethostname();

        $mail->From     = $data_array["email_from"];
        $mail->FromName = $data_array["email_from_name"];
        $mail->AddAddress($email_to_clean, $data_array["email_to_name"]);
        // $mail->AddReplyTo(filter_var($data_array["reply_to"], FILTER_SANITIZE_EMAIL));
        if(in_array(getenv("DKIM_active"), array("yes", "true", 1))) {
            $mail->DKIM_domain     = getenv("DKIM_domain");
            $mail->DKIM_private    = $this->root_path.'PHPMailer_DKIM/'.getenv("DKIM_private").'.htkeyprivate';
            $mail->DKIM_selector   = getenv("DKIM_selector");
            $mail->DKIM_passphrase = getenv("DKIM_passphrase");
            $mail->DKIM_identity   = getenv("DKIM_identity");
        }

        $mail->WordWrap = 50;
        $mail->IsHTML(true);

        $mail->Subject = $data_array["subject"];
        $mail->Body    = $data_array["message_body"];

        $mail->addCustomHeader("X-AntiAbuse", "This is a solicited email for ".$data_array["sender_domain"].".");
        $mail->addCustomHeader("X-AntiAbuse", $data_array["email_from"]);

        if(!$mail->send()) {
            throw new Exception($mail->ErrorInfo);
        } else {
            return true;
        }

    }
sendCore()

@method boolean sendCore($data_array, $smtp_hostname) Core PHPMailer library.
@access private
@return boolean
@param  array  $data_array    Mailer data array.
@param  String $smtp_hostname hostname to send to.
@throws Exception Mail end failure.

@author  Brian Tafoya
@version 1.0