Ver Mensaje Individual
  #3 (permalink)  
Antiguo 01/03/2005, 07:08
Avatar de Reynier
Reynier
 
Fecha de Ingreso: noviembre-2002
Ubicación: Por ahí en algún sitio
Mensajes: 1.844
Antigüedad: 21 años, 5 meses
Puntos: 1
Sip

Cluster eso lo se, la duda mia es por ejemplo como coger el contenido de un archivo cualquiera, añadirlo a una variable ya que contiene valores y luego ese contenido enviarlo por email. Por ejemplo, supon que ya tengo creado el fichero de la plantilla y que se llama email.htm. Ahora ese fichero dentro tiene algo como esto:
[HMTL]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Mi boletin</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD>
<BODY text=#000000 vLink=#0000ff link=#0000ff bgColor=#ffffff>
<CENTER>
<TABLE borderColor=#336699 cellPadding=15 width=400 border=2>
<TBODY>
<TR>
<TD align=middle bgColor=#336699 colSpan=2><div align="center"><FONT face="verdana, arial"
color=#ffffff><FONT size=+1><B><font size="+1">Bolet&iacute;n SIMPRO </font>
</B></FONT></FONT></div></TD>
</TR>

<TR>
<TD height="100%" colSpan=2><table width="100%" border="0">
<tr>
<td scope="col"><div align="left"><font color="#0099CC" size="2" face="Verdana, Arial, Helvetica, sans-serif">{content}</font></div></td>
</tr>
</table> </TD>
</TR>
<TR>
<TD align=middle colSpan=2><FONT face="verdana, arial" color=#336699
size=1>{pie} {ulink}{/ulink}</FONT></TD>
</TR></TBODY>
</TABLE>
</CENTER>
</BODY>
</HTML>
[/HMTL]
ahora en el código mío yo hago esto:
Código PHP:
$textbody "<table width=\"95%\" align=\"center\">"
        
."<tr>"
        
."<td width=\"100%\" height=\"20\" bgcolor=\"#6699CC\"><img src=\"".$nukeurl."/modules/".$module_name."/images/boletin/icon_www.jpg\" border=0 align='absmiddle'>&nbsp;<a href=\"".$nukeurl."/modules.php?name=Downloads\" title=\"Our latest downloads\" target=\"_blank\"><b><font size='3' color='#FFFFFF'>".$moddescargas."&nbsp;"._NBMDOWN."</font></b></a></td>"
        
."</tr>"
        
."</table>\n";

// Consulta para obtener todos los tópicos disponibles
 
$qct     $db->sql_query("SELECT * FROM ".$prefix."_topics");
 
$textbody .= "<table width=\"95%\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\" align=\"center\">"
        
."<tr>"
        
."<td colspan=\"6\" width=\"100%\" height=\"20\" bgcolor=\"#6699CC\"><img src=\"$nukeurl/modules/".$module_name."/images/boletin/icon_noticias.jpg\" border=0 align='absmiddle'>&nbsp;<a href=\"".$nukeurl."/modules.php?name=Topics\"><font size='3' color='#FFFFFF'><b>$modboletin_numero "._NBMNEWS_TIT."</b></font></a></td>"
        
."</tr>";
 
$categories = array();
 
$inc 0;
 while(
$fct mysql_fetch_assoc($qct)){
  
$cat =  "<tr><td colspan=\"6\" height=\"20\" bgcolor=\"#F0F8FE\"><img src='".$nukeurl."/images/topics/".$fct['topicimage']."' border=0 width=\"20\" height=\"20\" align='absmiddle' alt=\"".$fct['topictext']."\" class=\"cursor\">&nbsp;<a href=\"".$nukeurl."/modules.php?name=Topics\" title=\"Mostrar todos las noticias por temas\" target=\"_blank\"><b><font size='3' color='#000000'>".$fct['topictext']."</font></b></a></td></tr>";
  
// Obtenemos las noticias de ese Topico
  
$qnt $db->sql_query("SELECT sid, catid, aid, title, topic, hometext from ".$prefix."_stories WHERE (topic=".$fct['topicid'].") ORDER BY time DESC LIMIT 0, $numero");
  
$nnt $db->sql_numrows($qnt);
  for(
$i=0;$i<$nnt;$i++){
   
$fnt mysql_fetch_assoc($qnt);
   
$cat .=  "<tr><td colspan=\"6\" height=\"20\" bgcolor=\"#F0F8FE\"><a href=\"".$nukeurl."/modules.php?name=News&file=article&sid=".$fnt['sid']."&mode=&order=0&thold=0\" title=\"Mostrar noticia completa\" target=\"_blank\">&nbsp;&nbsp;".$fnt['title']."</a></td></tr>";
  }
  
array_push($categories$cat);
 }
 for(
$i=0;$i<count($categories);$i++){
  
$textbody .= $categories[$i];
 }

//coger template $modboletin_plantilla
$fp   fopen("modules/$module_name/images/plantillas/".$plantilla."/email.htm","r");
$html fread($fp,filesize("modules/$module_name/images/plantillas/".$plantilla."/email.htm"));
fclose($fp);
$html str_replace("{pie}",$modboletin_pie,$html);
$html str_replace("images/",$nukeurl."/modules/$module_name/images/plantillas/".$plantilla."/images/",$html);
$html str_replace("{content}",$textbody,$html); 
lo que quiero saber es como mandar por correo el contenido de la variable $textbody y de la plantilla ya conformado.

Salu2
__________________
Ing. Reynier Pérez Mira