Foros del Web » Programando para Internet » PHP »

Como Puedo Mandar Un Mail Desde Php

Estas en el tema de Como Puedo Mandar Un Mail Desde Php en el foro de PHP en Foros del Web. NECESITO AYUDA EN COMO PUEDO MANDAR UN MAIL DESDE PHP CON EL SIGUIENTE CODIGO DEL FORMULARIO <html> <head> <title>mail</title> </head> <fotm action="enviar.php" metod="post"> <p> DESTINATARIO ...
  #1 (permalink)  
Antiguo 04/11/2003, 00:05
 
Fecha de Ingreso: noviembre-2003
Ubicación: Puente de ixtla
Mensajes: 773
Antigüedad: 20 años, 5 meses
Puntos: 0
Exclamación Como Puedo Mandar Un Mail Desde Php

NECESITO AYUDA EN COMO PUEDO MANDAR UN MAIL DESDE PHP CON EL SIGUIENTE CODIGO DEL FORMULARIO

<html>
<head>
<title>mail</title>
</head>
<fotm action="enviar.php" metod="post">
<p> DESTINATARIO <input type="text" name="destinatario"></p>
<br>
<p> ASUNTO <input type="text" name="asunto"></p>
<br>
<p> TU NOMBRE <input type="text" name="tunombre"></p>
<br>
<p> MENSAJE <textarea name="mensaje" rows="20" cols="70"></textarea>
<input type="submit" value="enviar"><input type="reset" value="borrar">

ese seria el codigo del formulario pero el del php no se yo lo pongo asi y me marca error

<?
$destinatario=""
$asunto=""
$tunombre=""
$mensaje=""
mail ($destinatario, $asunto, $tunombre,$mensaje)
?>
<html>
<head>
<title>mail enviado</title>
</head>

<body>
<p> tu email ha sido enviado

si pueden ayudarme se los agradeceria mucho
__________________
°º¤ø,¸¸,ø¤º°`°º¤ø,¸S@M°º¤ø,¸¸,ø¤º°`°º¤ø,¸.
Dios solo nos dio el 0 y el 1 y con solo eso hemos construido un universo
  #2 (permalink)  
Antiguo 04/11/2003, 00:18
Avatar de Sebastian1046  
Fecha de Ingreso: junio-2003
Mensajes: 278
Antigüedad: 20 años, 10 meses
Puntos: 0
creo que esto es asi:

remplasa esto
<?
$destinatario=""
$asunto=""
$tunombre=""
$mensaje=""
mail ($destinatario, $asunto, $tunombre,$mensaje)
?>

por esto


<?
$destinatario=$_POST["destinatario"];
$asunto=$_POST["asunto"];
$tunombre=$_POST["tunombre"];
$mensaje=$_POST["mensaje"];
mail ($destinatario, $asunto, $tunombre,$mensaje)
?>


saludos
__________________
Agradesco infinitamente a toda la gente del foro que me ayudo/a.
  #3 (permalink)  
Antiguo 04/11/2003, 07:05
O_O
 
Fecha de Ingreso: enero-2002
Ubicación: Santiago - Chile
Mensajes: 34.417
Antigüedad: 22 años, 3 meses
Puntos: 129
En las FAQ's tienes vários ejemplos completos .. y también por supuesto en la documentación oficial de PHP:

www.php.net/mail

Estás empleando mál lo parámetros de la función mail() .. el campo "DE" (tu $tunombre) no es un parámetro .. se ha de indicar como parte de las cabeceras del e-mail en "FROM: $tunombre ..."


Un saludo,
__________________
Por motivos personales ya no puedo estar con Uds. Fue grato haber compartido todos estos años. Igualmente los seguiré leyendo.
  #4 (permalink)  
Antiguo 04/11/2003, 23:50
 
Fecha de Ingreso: noviembre-2003
Ubicación: Puente de ixtla
Mensajes: 773
Antigüedad: 20 años, 5 meses
Puntos: 0
les agradesco la ayuda enrealidad si me sirvio gracias
__________________
°º¤ø,¸¸,ø¤º°`°º¤ø,¸S@M°º¤ø,¸¸,ø¤º°`°º¤ø,¸.
Dios solo nos dio el 0 y el 1 y con solo eso hemos construido un universo
  #5 (permalink)  
Antiguo 05/11/2003, 05:55
Avatar de drcyber  
Fecha de Ingreso: julio-2002
Mensajes: 826
Antigüedad: 21 años, 8 meses
Puntos: 2
Pásate por: http://www.forosdelweb.com/showthrea...ht=formularios

Saludos.
__________________
Dr. Cyber
Ingeniarte.com
(soy el mismo Takitei)
  #6 (permalink)  
Antiguo 06/11/2003, 23:19
 
Fecha de Ingreso: noviembre-2003
Ubicación: Puente de ixtla
Mensajes: 773
Antigüedad: 20 años, 5 meses
Puntos: 0
hola sebastian sabes si tengo un pequeño problema porque no manda el e-mail si no que nadamas se queda asi gracuas y si me pudieras ayudar
__________________
°º¤ø,¸¸,ø¤º°`°º¤ø,¸S@M°º¤ø,¸¸,ø¤º°`°º¤ø,¸.
Dios solo nos dio el 0 y el 1 y con solo eso hemos construido un universo
  #7 (permalink)  
Antiguo 07/11/2003, 08:43
Avatar de Sebastian1046  
Fecha de Ingreso: junio-2003
Mensajes: 278
Antigüedad: 20 años, 10 meses
Puntos: 0
un ayuda mejorada ...

bueno...mira algo sencillo seria que te pase algun sistema para mandar e-mail en php que funcione.....asi que te paso este que es el que uso yo.
en la misma carpeta crea un archivo mail.php y contacto.htm con el siguiente codigo:

mail.php (donde dice tu email tienes que poner el email)
---------------------------------------------

<?
if($enviar)
{
$nombre=$_POST["nombre"];
$email=$_POST["email"];
$otro=$_POST["otro"];
$mensaje="nombre (".$nombre.") email (".$email.") mensaje (".$otro.")";
mail("Tu email","Contacto",$mensaje);
echo "Su Mensaje ha sido enviado...";
}?>

---------------------------------------------

contacto.htm
----------------------------------------------

<html>
<head>
<title>TU PAGINA</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<STYLE TYPE="text/css">
<!--
BODY {
scrollbar-arrow-color:#ffffff;
scrollbar-base-color:#000000;
scrollbar-shadow-color:#000000;
scrollbar-face-color:#42525A;
scrollbar-highlight-color:#42525A;
scrollbar-dark-shadow-color:white;
scrollbar-3d-light-color:#9BAAC1;
background-color: #000000;
}
//.style1 {font-size: 9px}
.style20 {
font-weight: bold;
font-size: 16px;
color: #FFFFFF;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style17 { color: #FFFFFF;
font-weight: bold;
font-size: 12px;
}
.style18 {
font-size: 12px;
color: #FFFFFF;
}
.style21 {color: #FFFFFF}
.style22 {
color: #000000;
font-size: 9px;
}
.style24 {color: #FF0000}
-->
</STYLE>
<body bgcolor="#FF9700" text="#0000FF" link="#0000FF" vlink="#0000FF" alink="#0000FF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table width="202" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"></div></td>
</tr>
</table>
<table width="505" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="505" align="center">
<? else
{?>
<form method="post" action="mail.php">
<table width="443" border="1" cellpadding="0" cellspacing="0" bordercolor="#4A6D7B" bgcolor="#3F5665">
<tr>
<td align="center"><table width="30" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="336" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><font color="#FFFFFF" size="2" face="Comic Sans MS"><strong>Nombre:
</strong></font>
<input name="nombre" type="TEXT" id="nombre" size=30>
</div></td>
</tr>
</table>
<table width="30" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="336" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><font color="#FFFFFF" size="2" face="Comic Sans MS"><strong>E-Mail:
</strong></font>
<input name="email" type="TEXT" id="email" size=30>
</div></td>
</tr>
</table>
<table width="30" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="337" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><strong><font color="#FFFFFF" size="2" face="Comic Sans MS">Mensaje:</font></strong>
<textarea name="otro" cols=28 rows=5 id="otro"></textarea>
</div></td>
</tr>
</table>
<table width="30" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<input type="submit" name="enviar" value="enviar">
<table width="30" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</form>

<? }?>
&nbsp;</td>
</tr>
</table>
<table width="529" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><font color="#000000" size="2" face="Comic Sans MS">&nbsp;</font></td>
</tr>
</table>
<table width="30" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
</table> </td>
</tr>
</table>
</body>
</html>

---------------------------------------------

(ademas se fija si el e-mail es correcto)
espero que te funcione!
saludos.
__________________
Agradesco infinitamente a toda la gente del foro que me ayudo/a.

Última edición por Sebastian1046; 07/11/2003 a las 08:45
  #8 (permalink)  
Antiguo 04/12/2003, 00:46
 
Fecha de Ingreso: noviembre-2003
Ubicación: Puente de ixtla
Mensajes: 773
Antigüedad: 20 años, 5 meses
Puntos: 0
bueno te doy las gracias porque ora si me sirvio
__________________
°º¤ø,¸¸,ø¤º°`°º¤ø,¸S@M°º¤ø,¸¸,ø¤º°`°º¤ø,¸.
Dios solo nos dio el 0 y el 1 y con solo eso hemos construido un universo
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 11:55.