isSMTP(); /* // Enable verbose debug output $mail->SMTPDebug = 2; */ // Specify main and backup SMTP servers $mail->Host = Config::get('phpmailer', 'smtp_server'); $mail->Port = Config::get('phpmailer', 'smtp_port'); if (Config::get('system', 'smtp_secure') && Config::get('phpmailer', 'smtp_port_s')) { $mail->SMTPSecure = Config::get('phpmailer', 'smtp_secure'); $mail->Port = Config::get('phpmailer', 'smtp_port_s'); } if (Config::get('phpmailer', 'smtp_username') && Config::get('phpmailer', 'smtp_password')) { $mail->SMTPAuth = true; $mail->Username = Config::get('phpmailer', 'smtp_username'); $mail->Password = Config::get('phpmailer', 'smtp_password'); } if (Config::get('phpmailer', 'smtp_from')) { $mail->setFrom(Config::get('phpmailer', 'smtp_from'), Config::get('sitename')); } } // subject $mail->Subject = $b['messageSubject']; // add text $mail->AltBody = $b['textVersion']; if (!empty($b['toEmail'])) { $mail->addAddress($b['toEmail']); } // html version if (!empty($b['htmlVersion'])) { $mail->isHTML(true); $mail->Body = $b['htmlVersion']; } /* // additional headers if (!empty($b['additionalMailHeader'])) { $mail->addCustomHeader($b['additionalMailHeader']); } */ $mail->send(); } catch (Exception $e) { echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo; die(); } }