Gracias ya lo logre
este seria el codigo correcto, no tenia errores de logica sino de sintaxis al final me quedo asip:
Código PHP:
<?php
$a=$_POST['title'];
$b=$_POST['to'];
$c=$_POST['cc'];
$d=$_POST['dear'];
$f=$_POST['url'];
$g=$_POST['IPB'];
$h=$_POST['IPRM'];
$i=$_POST['IPRF'];
$j=$_POST['MRMF'];
$k=$_POST['GC'];
$l=$_POST['OM'];
$m=$_POST['DD'];
$file=file_get_contents('mail_base.html');
$file=str_replace('#title#',$a,$file);
$file=str_replace('#dear#',$d,$file);
$file=str_replace('#url#',$f,$file);
$n=substr($a,0,9);
$file=str_replace('#wo#',$n,$file);
$file=str_replace('#u1#',$g,$file);
$file=str_replace('#u2#',$h,$file);
$file=str_replace('#u3#',$i,$file);
$file=str_replace('#u4#',$j,$file);
$file=str_replace('#u5#',$k,$file);
$file=str_replace('#u6#',$l,$file);
$file=str_replace('#u7#',$m,$file);
$file=str_replace('#linkApproved#','http://XXXXXX.XXX/approved.php?id='.base64_encode($a),$file);
$a=$a.' - Notification';
$to = explode(',', $b);
$cc=explode(',', $c);
$nt=$to[0];
$nameto=explode("@",$nt);
$nameto1=ucwords(str_replace('.',' ',$nameto[0]));
require_once('include/class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$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
$num1 = count($to);
$num2 = count($cc);
try {
$mail->Host = "mail.yourdomain.com"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "XXXXXXXXXXXXX"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "XXXXXXX"; // GMAIL username
$mail->Password = "XXXXXXX"; // GMAIL password
$num = count($to); // numero de elementos
$mail->AddReplyTo($nt,$nameto1);
for ($i=0; $i < $num; $i++) {
$tn=trim($to[$i]);
$meto=explode('@',$tn);
$meto1=ucwords(str_replace('.',' ',$meto[0]));
$mail->AddAddress($tn,$meto1);
}
for ($j=0; $j < $num2; $j++) {
$ton=trim($cc[$j]);
$meto2=explode('@',$ton);
$meto3=ucwords(str_replace('.',' ',$meto2[0]));
$mail->AddCC($ton,$meto3);
}
$mail->SetFrom('xxxxxx', 'xxxx');
$mail->AddReplyTo('xxxxx', 'xxxx');
$mail->Subject = $a;
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML($file);
$mail->Send();
echo "Message Sent OK</p>\n";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
?>