hola a todos por ahi!!!
Tengo un formulario el cual necesito utilizar para que lleguen a mi correo las consultas.
Código:
<FORM name="formulario" method="post" action="php/enviar.php" enctype="multipart/form-data">
<table width="519" border="0" align="center" class="tblform">
<tr>
<td >Nombre y Apellido:</td>
<td><input name="nombre" type="text" id="nombre" size="25"></td>
</tr>
<tr>
<td>E-mail:</td>
<td><input name="email" type="text" id="email" size="25"></td>
</tr>
<tr>
<td>Consulta:</td>
<td> <textarea name="consulta" id="consulta" cols="30" rows="3"></textarea></td>
</tr>
</table>
<br>
<table border="0" align="center">
<tr>
<td> <input type="submit" value="Enviar"> </td>
<td> <input type="reset" value="Borrar"> </td>
</tr>
</table>
</form>
El tema es que el hosting no soporta el envio de mails segun la respuesta que me dieron, por lo que investigue deberia usar phpMailer no?
Bueno hice esto... pero no funciona.
Código PHP:
//recogida de información
$nombre = $_POST[nombre];
$email = $_POST[email];
$consulta = $_POST[consulta];
//se compone el mensaje
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail -> From = "[email protected]";
$mail -> FromName = "mi nombre";
$mail->Host = 'ssl://smtp.gmail.com';
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'miclave';
$mail->Subject = "Test";
$mail->AddAddress("[email protected]");
$body .= "Nombre: $nombre\r\n";
$body .= "Email: $email\r\n";
$body .= "Consulta: $consulta\r\n";
$mail->Body = $body;
$mail->Send();
echo "envio exitoso.";
Cuando hago el envio sale el error:
Could not instantiate mail function. envio exitoso.
Alguien tiene idea que puede ser? Gracias!!!