Tengo el siguiente codigo para que los usuarios me contacten y de esta forma se me envie un correo a mi direccion de email:
Código PHP:
<?php
$name=strip_tags($_POST["name"]);
$subject=strip_tags($_POST["subject"]);
$email=strip_tags($_POST["email"]);
//$message=strip_tags($_POST["message"]);
if (empty($name) || empty($subject) || empty($email) || empty($message))
{
$error="Alguno o todos los campos no fueron rellenados.";
$redir='<a href="contact.php">[ Volver a la página anterior ]</a>';
include("error.php");
}
elseif (!eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,6}$",$email))
{
$error="El e-mail ingresado es incorrecto.";
$redir='<a href="contact.php">[ Volver a la página anterior ]</a>';
include("error.php");
}
else
{
$message='
<html>
<head>
</head>
<body>
<table>
<tr>
<td>
Este es un mail de prueba
</td>
</tr>
</table>
</body>
</html>
';
$header='MIME-Version: 1.0'."\r\n";
$header.='Content-type: text/html; charset=iso-8859-1'."\r\n";
$header.='To: '.$adminemail.' <'.$adminemail.'>'."\r\n";
$header.='From: '.$email.' <'.$email.'>'."\r\n";
//$header.='Cc: [email protected]'."\r\n";
//$header.='Bcc: [email protected]'."\r\n";
//http://www.mcanam.com/utilidades/cabeceras_mail.htm
echo 'Compruebo que $adminemail existe:';
echo '<br>';
echo '$adminemail:'.$adminemail;
mail($adminemail, $subject, $message, $header);
}
?>
Pero cuando lo ejecuto obtengo el siguiente error:
Compruebo que $adminemail existe:
$adminemail:
[email protected] Warning: mail() [
function.mail]: SMTP server response: 550 Sender address must be specified. in
\\hmfsw00\web00\DTC008\hdm-tech.net.ar\public_html\contact_script.php on line
82
Alguna sugerencia?