Quien me pueda ayudar lo agradezco. Dejo el código php, el error me lo tira en una linea del biblio.php donde cierra la función "EnviarMail", dejo también esta función.
Código PHP:
<?php
include ('../misc/biblio.php');
$Fecha = date ("d/m/Y");
$Hora = date ("H:i:s");
$DB = "MiscIntra";
$DBOSDE = "OSDE";
if ($accion=="R") {
$sql = "UPDATE ANSES_Consultas SET idTipoRespuesta = ".$_POST['idTipoResponder'].", txtRespuesta = '".str_replace ("'", "\"", $_POST['txtR'])."', fechaRespuesta = '".ConvDateARGtoServer($Fecha)." ".$Hora."', estado=4 WHERE nroid = ".$_POST['idConsulta'];
}
if(Ejecutar($sql, $DB, CONNSQL)){
$sqlASP = "sp_GetConsultaANSES @idConsulta=".$_POST['idConsulta'];
if($datosASP = TrDatConn($sqlASP, $DB, CONNSQL)){
$subjet = "Consulta ANSES";
$texto = $datosASP[0]["nya"] . " ( " . $datosASP[0]["cuildni"] . " ) \r\n";
$textoC = $datosASP[0]["nya"] . "\r\n";
$texto .= "Respuesta: " . $datosASP[0]["titulo"] . "\r\n";
$textoC .= "Respuesta: " . $datosASP[0]["titulo"] . "\r\n";
if ($datosASP[0]["txtRespuesta"]!="") {
$texto .= $datosASP[0]["txtRespuesta"];
$textoC.= $datosASP[0]["txtRespuesta"];
}
$texto = nl2br ($texto);
$textoC = nl2br ($textoC);
$nya = $datosASP[0]["nya"];
$idS = $datosASP[0]["idSolicitante"];
$nyaS = $datosASP[0]["nyaSolicitante"];
$emailS = $datosASP[0]["emailS"];
$idP = $datosASP[0]["idPromotor"];
EnviarMail($nyaS, $emailS, $subjet, $texto, "[email protected]");
$sqlP = "usuarioConDatosComp @nroid=" . $idP;
if($datosP = TrDatConn($sqlP, $DBOSDE, CONNSQL)){
$gerenciaHabilitadaCelular = false;
$nyaP = $datosP[0]["nombres"]. " " . $datosP[0]["apellidos"];
$emailP = $datosP[0]["email"];
$CodigoAreaCel = $datosP[0]["CodigoAreaCel"];
$PrefijoCel = $datosP[0]["PrefijoCel"];
$CodCel = $datosP[0]["CodCel"];
$NumeroCel = $datosP[0]["NumeroCel"];
EnviarMail($nyaP, $emailP, $subjet, $texto, "[email protected]");
$SQL_GHC = "exec usuarioGerenciaHabilitadaCelular @idUsuario = " . $idP;
if (TrDatConn($SQL_GHC, $DBOSDE, CONNSQL)) {
$gerenciaHabilitadaCelular = true;
}
if ($gerenciaHabilitadaCelular and $NumeroCel!="") {
$emailCP = $CodigoAreaCel.$CodCel.$NumeroCel."@emocion.net.ar";
EnviarMail($nyaP, $emailCP, $subjet, $textoC, "[email protected]");
}
}
}
header('location:listado.php?');
exit();
}
?>
Código PHP:
function EnviarMail($nya, $email, $subjet, $texto, $de = "", $type = "html"){
// múltiples recipientes
$para = $email;
// asunto
$asunto = $subjet;
// mensaje
$mensaje = $texto;
// Para enviar correo HTML, la cabecera Content-type debe definirse
$cabeceras = 'MIME-Version: 1.0' . "\r\n";
if ($type == "html") {
$cabeceras .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
}else {
$cabeceras .= 'Content-type: text/plain; charset=iso-8859-1' . "\r\n";
}
// Cabeceras adicionales
$cabeceras .= 'To: '.$nya.' <'.$email.'>' . "\r\n";
if ($de == "") {
$cabeceras .= 'From: OSDE INTRANET <[email protected]>' . "\r\n";
}else {
$cabeceras .= 'From: <'.$de.'>' . "\r\n";
}
// Enviarlo
mail($para, $asunto, $mensaje, $cabeceras);
}