Jump to content

Sending mail error


elcash_36

Recommended Posts

Hello, my name is Martin. I'm new to PHP and I'm trying to create a form to send e-mails.

 

I've done everything but in the moment I click on "Enviar" it appears this message:

Parse error: syntax error, unexpected T_VARIABLE in /home/lucas/public_html/Espanol/Contacto/send.php on line 21

 

Here is my PHP code:

<?php

$Nombre = $_POST['Nombre'];

$email = $_POST['email'];

$Empresa = $_POST['Empresa'];

$Asunto = $_POST['Asunto'];

 

$header = 'De: ' . $email . " \r\n";

$header .= "X-Mailer: PHP/" . phpversion() . " \r\n";

$header .= "Mime-Version: 1.0 \r\n";

$header .= "Content-Type: text/plain";

 

$mensaje = "Este mensaje fue enviado por: " . $Nombre . ", de " . $Empresa . " \r\n";

$mensaje .= "Su mail es: " . $email . " \r\n";

$mensaje .= "Asunto: " . $Asunto . " \r\n";

$mensaje .= "Mensaje: " . $_POST['mensaje'] . " \r\n";

$mensaje .= "Enviado: " . date('d/m/Y', time());

 

$para = '[email protected]';

$asunto =  'Asunto';

 

if (mail($para, $asunto, $mensaje $header)) {

  echo("<p>¡Mensaje enviado correctamente!</p>");

} else {

  echo("<p>¡ERROR! Mensaje no enviado...</p>");

}

?>

 

 

Thank you very much!

Link to comment
https://forums.phpfreaks.com/topic/190492-sending-mail-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.