IsSMTP(); // telling the class to use SMTP $mail->Host = "b8world.com"; // SMTP server $mail->SMTPAuth = true; // authentication enabled $mail->Port = 587; $mail->CharSet = $charset; $smtpusername="mailservices@b8world.com"; $smtppassword="cJldETQ2V52o"; $mail->Username = $smtpusername; // SMTP account username $mail->Password = $smtppassword; // SMTP account password $mail->SetFrom("mailservices@b8world.com", 'Bateworld'); $mail->AddReplyTo("mailservices@b8world.com", 'Bateworld'); $mail->AddAddress($recipient); $mail->Subject = $subject; $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically $mail->MsgHTML($message); $mail->Send(); } catch (phpmailerException $e) {mail("porembaphilip@gmail.com", "MAIL ERROR", $e->errorMessage());echo $e->errorMessage(); //Pretty error messages from PHPMailer } catch (Exception $e) { echo $e->getMessage(); //Boring error messages from anything else! mail("porembaphilip@gmail.com", "MAIL ERROR", $e->getMessage()); } $themailsent="Mail Sent"; } ?>