isSMTP(); // Set mailer to use SMTP $mail->Host = $mailhost; // Specify main and backup server $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = $mailusername; // SMTP username $mail->Password = $mailpassword; // SMTP password $mail->SMTPSecure = $mailmethod; // Enable encryption, 'ssl' also accepted $mail->Port = $mailport; $mmessage="mailtoken"; include('include/mailhtml.php'); // Email body content $htmlContent = $mailmessagetoken; $mail->From = $from; $mail->FromName = 'CIMAC Application Form System'; $mail->addAddress($to); // Add a recipient $mail->Subject = $subject; $mail->Body = $htmlContent; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; $mail->send(); // echo 'Message has been sent'; } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; }} ?>