Hi " .$row["firstname"].",

"; if($memo !=""){$memo="

".$memo."

";} $mailinfo="
"; $mailinfo .="
Message Recieved: ".$receive_date."
"; $mailinfo .="
Subject: ".$orig_subj."
"; $mailinfo .="
Member's Email: ".$mem_email."
"; $mailinfo .="
Member's Display Name: ".$mem_nic."
"; $mailinfo .="
Member's Mail Status: ".$mem_mailstatus."
"; $mailinfo .="
"; $fmsg=""; $fmsg .="
"; $fmsg .="
Fowarded Message _ _ _ _ _ _
"; $fmsg .="

".$thebody."

"; $fmsg .="
"; $message=$salutation.$memo.$mailinfo.$fmsg; //$message = tidy_parse_string($message); //tidy_clean_repair($message); $thetemplate=str_replace('[content]',$message,$thetemplate); $message=$thetemplate; $recipient=$row["emailaddress"]; $subject=$subject; $charset="UTF-8"; $mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch $mail->IsSMTP(); // telling the class to use SMTP try { $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "b8world.com"; // SMTP server $mail->SMTPAuth = true; // authentication enabled $mail->Port = 587; // $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail $mail->CharSet = $charset; $mail->Username = $m["username"]; // SMTP account username $mail->Password = $m["password"]; // SMTP account password //$mail->From = "mailservices@b8world.com"; $mail->SetFrom($m["username"], 'Bateworld'); $mail->AddReplyTo($m["username"], '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->AddAttachment('mailer/images/phpmailer.gif'); // attachment //$mail->AddAttachment('mailer/images/phpmailer_mini.gif'); // attachment $mail->Send(); //echo "Message Sent OK

\n"; } catch (phpmailerException $e) {mail("phil@b8world.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("phil@b8world.com", "MAIL ERROR", $e->getMessage()); } }//end while if (($mbox = imap_open("{b8world.com:143/novalidate-cert}INBOX", $m["username"], $m["password"])) !=false) { $move="INBOX.Forwarded"; if(imap_mail_move ( $mbox , $imapuid , $move, CP_UID)) { imap_expunge($mbox); imap_close($mbox); } } else { $em=$em."Failed To Move"; } $arr = array ('result'=>$em); echo json_encode($arr); ?>