function sendMail($address, $name, $subject, $message) { global $config; if ($config['allowemails']) { // instantiate the class $mail = new mailer(); // Set the subject $mail->Subject = $subject; // Body $mail->Body = str_replace(array("<br", "<br />"), "\r\n", $message); // Add an address to send to. $mail->AddAddress($address, $name); $mail->Send(); $mail->ClearAddresses(); $mail->ClearAttachments(); } }