public static function sendEmail($vars, $email, $body, $alt, $clicktrack = true) { $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Username = CShell::SMTPUN(); $mail->Password = CShell::SMTPPW(); $mail->IsHTML(true); $mail->SetFrom($vars["from"]); $mail->FromName = $vars["name"]; $mail->AddReplyTo($vars["reply"]); $mail->Subject = $vars["subject"]; $mail->MsgHTML($body); $mail->AltBody = $alt; $x_smtpapi = array('category' => array('webinar', $vars['category'])); if (!$clicktrack) { $x_smtpapi['filters'] = array('clicktrack' => array('settings' => array('enable' => 0))); } $blah = 'X-SMTPAPI: ' . json_encode($x_smtpapi); $mail->AddCustomHeader($blah); $mail->AddAddress($email); $response = $mail->Send(); $mail->ClearAddresses(); return $response; }