
02/08/2004, 17:38
|
 | | | Fecha de Ingreso: mayo-2004
Mensajes: 1.266
Antigüedad: 20 años, 9 meses Puntos: 2 | |
Basicamente sería esto: Código PHP: <?
function sendMail($from,$subject,$body){
$headers = "From: $from\n";
mail("[email protected]",$subject,$body,$headers);
}
if (isset($_POST["enviar"])){
$from=$_POST["from"];
$subject=$_POST["subject"];
$body=$_POST["body"];
sendMail($from,$subject,$body);
echo "mensaje enviado correctamente";
}else{
?>
<HTML>
<body>
<div align="center">
<form method="post" name="formContact" action="<?=$_SERVER['PHP_SELF']?>" >
Tú dirección de correo<br>
<input name="from" type="text" style="width:450">
<br>
<br>
Asunto<br>
<input name="subject" type="text" style="width:450" maxlength="100">
<br>
<br>
Mensaje<br>
<textarea name="body" style="width:450;height:150;" ></textarea>
<br>
<br>
<input type="submit" name="enviar" value="enviar" class="boton2_12">
</form>
</div>
</body>
</HTML>
<? } ?> |