Hola bueno el problema que tuve fue el siguiente, quise hacer un formulario de contacto medio improvisado con php y html y cuando lo ejecuto me tira un error si alguien me puede ayudar le agradeceria mucho! tengo esto:
Código:
<!DOCTYPE HTML>
<html lang="es">
<head>
<meta charset="utf-8">
<link rel="styletsheet" type="text/css" href="stylesheet.css">
<title>Curso PHP</title>
</head>
<body>
<form action="envio.php" method="post">
<table>
<tr><td>Nombre:</td><td><input type="text" name="nombre" maxlength="50" placeholder="Introduce tu nombre" required /></td></tr>
<tr><td>Apellido:</td><td><input type="text" name="apellidos" maxlength="50" placeholder="Introduce tus apellidos" required /></td></tr>
<tr><td>Teléfono:</td><td><input type="tel" name="telefono"/><td></td></tr>
<tr><td>Email:</td><td><input type="email" name="correo" placeholder="Introduce un correo válido" required /></td></tr>
<tr><td>Comentario:</td><td><textarea rows="10" cols="40" name="comentario" required /></textarea></td></tr>
<tr><td></td><td><input type="submit" value="Enviar datos" name="submit"/></td></tr>
</table>
</form>
</body>
</html>
y esto...
Código:
<?php
$name = strip_tags($_POST["nombre"]);
$apellido = strip_tags($_POST["apellidos"]);
$tel = strip_tags($_POST["telefono"]);
$mail = strip_tags($_POST["correo"]);
$mensaje = strip_tags($_POST["comentario"]);
$fecha = time();
$fechaFormato = date("j/n/Y",$fecha);
/*from: datos del emisor
To: datos del receptor
Date: Fecha/Hora
Subject: Contenido*/
$cabecera = "MIME-VERSION: 1.0";
$cabecera .= "Content-type: text/html; Charset=UTF-8";
$cabecera .= "From: Formulario enviado desde Nico";
$correoDestino = "mi mail";
$asunto = "Enviado por " . $name . " ". $apellido;
$cuerpo = "Correo enviado por: " . $name . " ". $apellido;
$cuerpo .= " con fecha: " . $fechaFormato;
$cuerpo .= "Telefono: " . $tel;
$cuerpo .= "Email: " . $mail;
$cuerpo .= "mensaje: " . $mensaje;
//Enviar el correo
ini_set("SMTP","aspmx.l.google.com");
mail($correoDestino, $asunto, $cuerpo, $cabecera);
?>
obviamente donde dice "mi mail" lo cambie por un mail mio de gmail para probar el formulario.
Bueno la cuestion es que cuando pongo los datos y lo envio me salta este error:
Warning: mail(): SMTP server response: 550-5.7.1 [190.99.114.194 11] Our system has detected that this message is 550-5.7.1 not RFC 2822 compliant. To reduce the amount of spam sent to Gmail, 550-5.7.1 this message has been blocked. Please review 550 5.7.1 RFC 2822 specifications for more information. w4si9270524lal.97 - gsmtp in I:\wamp\www\envio.php on line 35
agradeceria si me ayudan con esto! disculpen pero soy nuevo aca, saludos!