SMTPAuth = true; // enable SMTP authentication $mailObject->Port = 25; // set the SMTP server port $mailObject->Host = "localhost"; // SMTP server $mailObject->Username = "schoolappointments"; // SMTP server username $mailObject->Password = "Online3214++.."; // SMTP server password $mailObject->CharSet = "UTF-8"; $mailObject->IsSendmail(); // tell the class to use Sendmail $mailObject->ClearAddresses(); $mailObject->ClearAllRecipients(); $mailObject->ClearAttachments(); $mailObject->AddReplyTo($emailFrom, $emailReply); $mailObject->SetFrom($senderEmail, $emailReply, 1); $mailObject->Sender = $senderEmail; $mailObject->From = $senderEmail; $mailObject->AddAddress($emailTo, $emailRecipient); $mailObject->Subject = $emailSubject; $mailObject->IsMail(); // tell the class to use Mail $mailObject->IsSMTP(); // tell the class to use SMTP $mailObject->IsSendmail(); // tell the class to use SendMail // Process a template if one is passed if (isset($templateFile) && strlen($templateFile) && is_file($templateFile)) { $template = file_get_contents($templateFile); } // Use template if available if (isset($template) && strlen($template)) { $Message = str_replace("{EMAIL_BODY_TEXT}",$emailMessage,$template); $mailObject->MsgHTML($Message); } else { if (strip_tags($emailMessage) == $emailMessage) { // Send as a plain text message $mailObject->Body = $emailMessage; } else { // Send HTML message $mailObject->MsgHTML($emailMessage); } } // Attach any attachments if (is_array($attachments) && count($attachments) > 0) { for ($i = 0; $i < count($attachments); $i++) { $file = $attachments[$i]; if (is_file($file)) { $mailObject->AddAttachment($file); } } } // Send message $mailObject->Send(); return(1); } } ?>