Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/04/2006, 23:31
Avatar de Pablus00
Pablus00
 
Fecha de Ingreso: diciembre-2003
Ubicación: A un click de distancia
Mensajes: 1.044
Antigüedad: 20 años, 4 meses
Puntos: 11
Formato de Email en php

Hola Colegas, necesito configurar el email que recibo de la siguiente manera:

tusitio.com - Compra Contra ReembolsoEmail enviado por pablo (prueba@prueba.con) el dia Thursday, April 20, 2006 at 02:03:24---------------------------------------------------------------------------Nombre: Direccion: Localidad: Provincia: CP: Telefono: Email: Como_nos_conociste: Productos: ---------------------------------------------------------------------------Quisiera que tenga esta estructura, con esa linea de puntos y esa distribusion de datos, pero no se como lograrlo.Las variables las recibo, pero desordenadas y sin estas lineas y titulos arriba. Esto fue generado por un script CGI de FormMail.y mi intencion es migrar para php. Alguien me podra anexar a mi codigo, para que quede asi? Este es parte del script CGI, (creo q es la parte que le da formato)# Otherwise, begin printing the response page. # else { # Print HTTP header and opening HTML tags. # print "Content-type: text/html\n\n"; print "<html>\n <head>\n"; # Print out title of page # if ($Config{'title'}) { print "<title>$safeConfig{'title'}</title>\n" } else { print "<title>Thank You</title>\n" } print " </head>\n <body"; # Get Body Tag Attributes # &body_attributes; # Close Body Tag # print ">\n <center>\n"; # Print custom or generic title. # if ($Config{'title'}) { print "<h1>$safeConfig{'title'}</h1>\n" } else { print "<h1>Thank You For Filling Out This Form</h1>\n" } print "</center>\n"; print "Below is what you submitted to $safeConfig{'recipient'} on "; print "$date<p><hr size=1 width=75\%><p>\n"; # If a sort order is specified, sort the form fields based on that. # if ($Config{'sort'} =~ /^order:.*,.*/) { # Set the temporary $sort_order variable to the sorting order, # # remove extraneous line breaks and spaces, remove the order: # # directive and split the sort fields into an array. # $sort_order = $Config{'sort'}; $sort_order =~ s/(\s+|\n)?,(\s+|\n)?/,/g; $sort_order =~ s/(\s+)?\n+(\s+)?//g; $sort_order =~ s/order://; @sorted_fields = split(/,/, $sort_order); # For each sorted field, if it has a value or the print blank # # fields option is turned on print the form field and value. # foreach $sorted_field (@sorted_fields) { local $sfname = &clean_html($sorted_field); if ($Config{'print_blank_fields'} || $Form{$sorted_field} ne '') { print "<b>$sfname:</b> $Form{$sorted_field}<p>\n"; } } } y este es mi php (sacado de un foro, ya que aun no manejo php)<?php
if(isset($_POST["nombre"]) && isset($_POST["titulo"]) && isset($_POST["mail"]) && isset($_POST["mensaje"]) ){
$fecha = date("D-M-y H:i");
$mymail = "[email protected]";
$subject = "Desde el Sitio.. =)";
$contenido = $_POST["nombre"]." Escribio :\n";
$contenido .= $_POST["mensaje"]."\n\n";
$contenido .= "el mensaje se escribio el ".$fecha;
$header = "From:".$_POST["mail"]."\nReply-To:".$_POST["mail"]."\n";
$header .= "X-Mailer:PHP/".phpversion()."\n";
$header .= "Mime-Version: 1.0\n";
$header .= "Content-Type: text/plain";
mail($mymail, $subject, utf8_decode($contenido) ,$header);
echo "&estatus=ok&";
}
?>Mas que agradecido
__________________
-- Nunca te des por vencido, aún vencido -- Web