Modoficar script de formulario de contacto

Ola "davidcortesb"
Primero,deseo agradecerte que me dediques un poco de tu valioso tiempo.
Espero que me puedas ayudar o aunque sea dar una idea de como solucionar este problemita:
diseñe mi web http://tucoachh.com.ar/index2.html
y el inconveniente surge cuando desde el formulario de contaco me envian el mail. En  mi casilla me aparece el aviso de "nuevo mail"pero cuando lo abro siempre esta en blanco.
Averigue en varios foros y me digeron que tendria que modificar algo en el archivo php.
Lo intente pero todo lo que cambie fue para peor.
Este formulario de contacto lo consegui en un foro y el php consta de dos partes + una planilla excel
(este es pincipal)
$archivo = fopen("formulario.csv" , "w");
if ($archivo) {
//variables que hayamos declarado en la pelicula de flash
$datos="Nombre del autor: $nom
+ Su email:,$email
+ Su empresa:,$empresa
+ Motivo del contacto:,$contacto
+ Mensaje:,$mensaje";
fputs ($archivo, $datos);
}
echo $pulsado;
fclose ($archivo);
?>
include "libmail.php";
$m= new Mail;
//correo desde el que se enviará
$m->From( "[email protected]" );
//correo al que se enviará. Se puede poner en ambos lugares el mismo correo
$m->To( "[email protected]" );
//el subject del email, será el email que haya escrito el usuario, salvo que lo cambiemos, pon lo que quieras
$m->Subject( "$email" );
//variables que hayamos declarado en la pelicula de flash
$m->Body( "Nombre del autor:
$nom
Su email:
$email
Su empresa:
$empresa
Motivo del contacto:
$contacto
Mensaje:
$mensaje" );
//Si queremos que el correo se envíe a más cuentas de correo, quitar las barras de comentario y especificar los correos
//$m->Cc( "alguien@algun_server.au");
//$m->Bcc( "alguien_mas@otro_server.es");
$m->Priority(1) ;
$m->Attach( "formulario.csv", "application/vnd.ms-excel", "attachment" );
$m->Send();
?>
          -------------------------------------------------
Y este es la otro(libreria)
]/*
this class encapsulates the PHP mail() function.
implements CC, Bcc, Priority headers
@version 1.3
- added ReplyTo( $address ) method
- added Receipt() method - to add a mail receipt
- added optionnal charset parameter to Body() method. This should fix charset problem on some mail clients
LASTMOD Fri Oct 6 15:46:12 UTC 2000
@author Leo West - [email protected]
*/
class Mail
{
/*
list of To addresses
@var array
*/
var $sendto = array();
/*
@var array
*/
var $acc = array();
/*
@var array
*/
var $abcc = array();
/*
paths of attached files
@var array
*/
var $aattach = array();
/*
list of message headers
@var array
*/
var $xheaders = array();
/*
message priorities referential
@var array
*/
var $priorities = array( '1 (Highest)', '2 (High)', '3 (Normal)', '4 (Low)', '5 (Lowest)' );
/*
character set of message
@var string
*/
var $charset = "UTF-8";
var $ctencoding = "7bit";
var $receipt = 0;
/*
Mail contructor
*/
function Mail()
{
$this->autoCheck( true );
$this->boundary= "--" . Md5( uniqid("myboundary") );
}
/*
activate or desactivate the email addresses validator
ex: autoCheck( true ) turn the validator on
by default autoCheck feature is on
@param boolean $bool set to true to turn on the auto validation
@access public
*/
function autoCheck( $bool )
{
if( $bool )
$this->checkAddress = true;
else
$this->checkAddress = false;
}
/*
Define the subject line of the email
@param string $subject any monoline string
*/
function Subject( $subject )
{
$this->xheaders['Subject'] = strtr( $subject, "\r\n" , " " );
}
/*
set the sender of the mail
@param string $from should be an email address
*/
function From( $from )
{
if( ! Is_string($from) ) {
exit;
}
$this->xheaders['From'] = $from;
}
/*
set the Reply-to header
@param string $email should be an email address
*/
function ReplyTo( $address )
{
if( ! Is_string($address) )
return false;
$this->xheaders["Reply-To"] = $address;
}
/*
add a receipt to the mail ie. A confirmation is returned to the "From" address (or "ReplyTo" if defined)
when the receiver opens the message.
@warning this functionality is *not* a standard, thus only some mail clients are compliants.
*/
function Receipt()
{
$this->receipt = 1;
}
/*
set the mail recipient
@param string $to email address, accept both a single address or an array of addresses
*/
function To( $to )
{
// TODO : test validité sur to
if( is_array( $to ) )
$this->sendto= $to;
else
$this->sendto[] = $to;
if( $this->checkAddress == true )
$this->CheckAdresses( $this->sendto );
}
/* Cc()
* set the CC headers ( carbon copy )
* $cc : email address(es), accept both array and string
*/
function Cc( $cc )
{
if( is_array($cc) )
$this->acc= $cc;
else
$this->acc[]= $cc;
if( $this->checkAddress == true )
$this->CheckAdresses( $this->acc );
}
/* Bcc()
* set the Bcc headers ( blank carbon copy ).
* $bcc : email address(es), accept both array and string
*/
function Bcc( $bcc )
{
if( is_array($bcc) ) {
$this->abcc = $bcc;
} else {
$this->abcc[]= $bcc;
}
if( $this->checkAddress == true )
$this->CheckAdresses( $this->abcc );
}
/* Body( text [, charset] )
* set the body (message) of the mail
* define the charset if the message contains extended characters (accents)
* default to us-ascii
* $mail->Body( "mél en français avec des accents", "iso-8859-1" );
*/
function Body( $body, $charset="" )
{
$this->body = $body;
if( $charset != "" ) {
$this->charset = strtolower($charset);
if( $this->charset != "us-ascii" )
$this->ctencoding = "8bit";
}
}
/* Organization( $org )
* set the Organization header
*/
function Organization( $org )
{
if( trim( $org != "" ) )
$this->xheaders['Organization'] = $org;
}
/* Priority( $priority )
* set the mail priority
* $priority : integer taken between 1 (highest) and 5 ( lowest )
* ex: $mail->Priority(1) ; => Highest
*/
function Priority( $priority )
{
if( ! Intval( $priority ) )
return false;
if( ! Isset( $this->priorities[$priority-1]) )
return false;
$this->xheaders["X-Priority"] = $this->priorities[$priority-1];
return true;
}
/*
Attach a file to the mail
@param string $filename : path of the file to attach
@param string $filetype : MIME-type of the file. Default to 'application/x-unknown-content-type'
@param...

1 respuesta

Respuesta
1
Cuando dices que te llega en blanco, ¿quieres decir sin texto y sin adjunto?
Quizás esta librería tenga algún error. Prueba a eliminar esta línea de tu código a ver si recibes el texto:
$m->Attach( "formulario.csv", "application/vnd.ms-excel", "attachment" );
Gracias por responder a mi pregunta .
Realice esa modificación que me aconcejaste y el "mail directamento no me llego a la casilla."
Aqui te pongo una imagen para que veas como llega el mail a mi casilla con todos los campos en blanco   .
Así llegan todos los mail.
Si te parece que hay una forma mas sencilla de script o si quieres realizar midificaciones en este no me opongo. varias personas me han dicho que es un poco rebuscado (por el excel y la libreria) para lo que yo necesito. El tema es que como no se que hacer con estos temas "php" estoy en el limbo.
 saludos y gracias por el tiempo que me dedicas.
El mensaje te llega vacío porque está incompleto tal y como indica el error que aparece.
Yo también te recomendaría que te olvidases de esta librería y usases el comando mail() estándar de PHP.
Tienes ejemplos de su uso en el manual:
http://es.php.net/manual/es/function.mail.php

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas