elcash_36 Posted February 1, 2010 Share Posted February 1, 2010 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 More sharing options...
Hybride Posted February 1, 2010 Share Posted February 1, 2010 if (mail($para, $asunto, $mensaje $header)) { is missing a comma. Change it to: if (mail($para, $asunto, $mensaje, $header)) { Link to comment https://forums.phpfreaks.com/topic/190492-sending-mail-error/#findComment-1004800 Share on other sites More sharing options...
elcash_36 Posted February 1, 2010 Author Share Posted February 1, 2010 Thank you!! Now I have a different problem... the e-mail doesn't appears in my Inbox. Link to comment https://forums.phpfreaks.com/topic/190492-sending-mail-error/#findComment-1004801 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.