Dejo el codigo :
Código PHP:
Ver original
<?php include("connect.php"); include("date_time_format.php"); $id=$_SESSION['id']; $usuario=$_SESSION['usuario']; $from_mem=$_SESSION['id']; $tid=$_REQUEST["id"]; $fid=$_SESSION["id"]; } else { } mysql_query ("Insert into 'dm_messages' ( dm_fid , dm_tid , dm_message , dm_subject , dm_msg_read,d_f_del,d_t_del, dm_onstamp) VALUES ( $fid,$tid,'$message'," ."'$subject'" .",'No','No','No','" .date("YmdHis",time())."')"); { //Gets member info $sql = "SELECT max(dm_id) FROM dm_messages" ; $id=$rs[0]; $rs0=mysql_fetch_array(mysql_query("select *,UNIX_TIMESTAMP(dm_onstamp) as ondate from dm_messages where dm_id=" .$id)); $ondate=dm_date($rs0["ondate"]); $sql= "SELECT * FROM dm_mails where dm_mailid=23"; { if($rs["sb_status"]=="yes") { $from =$rs["dm_fromid"]; $to = $rs1["email"]; $subject =$rs["dm_subject"]; $body=str_replace("%email%", $sb_null_char,str_replace("%pass%",$sb_null_char,$sb_null_char,str_replace("%lastname%", $rs1["lastname"],str_replace("%firstname%", $rs1["firstname"],str_replace("%usuario%",$rs1["usuario"], $rs["email"]) )))); $body=str_replace("%message_text%",$rs0["dm_message"],str_replace("%message_title%",$rs0["dm_subject"],str_replace("%sender_username%",$rs2["usuario"],str_replace("%message_date%",$ondate,$body)))); $header="From:" . $from . "\r\n" ."Reply-To:". $from ; { $header .= "\r\nMIME-Version: 1.0"; $header .= "\r\nContent-type: text/html; charset=iso-8859-1\r\n"; // $body=str_replace("\n","<br>",$body); } // echo "--from:-$from----to:-$to---sub:-$subject----head:-$header----"; //echo "<pre>$body</pre>"; //die(); if( $rs["sb_status"]=='yes') }// end if status is on } $errmsg="Tu mensaje ha sido enviado a ".$row["usuario"]; } ?>