🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #9100

email y php

#9100
From: David
Date: Mon, 02 Sep 2002 20:02
141 lines
3966 bytes
Hola a todos. a ver, tengo un peque�o problema.
Quiero enviar mails desde un formulario ya creado, pero no me deja,
dandome el siguiente error:

Warning: Failed to Connect in
C:\apache\htdocs\pagina_email\fenviar_mail.php on line 2


Mis paginas son las siguientes:

fenviar_mail.php

<?
  mail($txt_destinatario, $txt_asunto, $txt_mensaje, "From:
$txt_remitente");
?>


form_email.php

<html>
<head>
<title>Enviar E-Mail.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link rel="stylesheet" href="../modulos/plantilla.css" type="text/css">
</head>
<body>

<form name="form_mail" method="get" action="fenviar_mail.php">

 <table align="center" width="60%" border="0" cellspacing="0"
cellpadding="5" bgcolor="#CC0000">
 <tr>
 <td height="32">
 <div align="center"><b><font face="Verdana, Arial, Helvetica,
sans-serif" size="4" color="#FFFFFF">Enviar E-Mail.</font></b></div>
 </td>
 </tr>
 </table>
 <br><br>

 <div align="center">
  <table width="75%" border="1">
    <tr>
      <td width="25%">Destinatario (*):</td>
      <td width="75%">
          <input type="text" name="txt_destinatario" size="50"
maxlength="50">
        </td>
    </tr>
    <tr>
      <td width="25%">Remitente (*):</td>
      <td width="75%">
          <input type="text" name="txt_remitente" size="50"
maxlength="50">
        </td>
    </tr>
    <tr>
      <td width="25%">Asunto:</td>
      <td width="75%">
          <input type="text" name="txt_asunto" size="50" maxlength="50">

        </td>
    </tr>
    <tr>
      <td width="25%">Mensaje (*):</td>
      <td width="75%">
          <textarea name="txt_mensaje" cols="43" rows="5"></textarea>
        </td>
    </tr>
  </table>
</div>
<div align="left">
    <center>
       <br>
       El s&iacute;mbolo (*) indica que el campo es obligatorio, por lo
tanto, no puede dejarse en blanco.
       <br><br><br>
      <input type="submit" name="boton_enviar_mail" value="Enviar Mail"
onClick="comprobar_texts()">
    </center>
  </div>
</form>





<script language="JavaScript">
<!--
function comprobar_texts()
{
  if ((document.form_mail.txt_destinatario.value == "") ||
(document.form_mail.txt_remitente.value == "") ||
(document.form_mail.txt_mensaje.value == ""))
  {
     alert ("Se requieren m�s datos de los que has especificado. Debes
rellenar aquellos campos con el signo (*) para enviar el mail.");
  }
  else
  {
      if
((document.form_mail.txt_destinatario.value.indexOf('@',0)==-1))
      {
           alert ("La direcci�n de correo del destinatario es
incorrecta.");
      }
      else
      {
            if
((document.form_mail.txt_remitente.value.indexOf('@',0)==-1))
            {
                 alert ("La direcci�n de correo del remitente es
incorrecta.");
            }
            else
            {
                document.form_mail.submit();
            }
      }
  }
}
-->
</script>


</body>
</html>









Alguien puede echarme una manita, ya que no veo el error.

Muchas gracias.
Technical Details
Message-ID: <3D73C3EF.57F7431E@menta.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!docs50-58.menta.NET!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,b2194784cb020a10,start
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2002-09-02 13:04:43 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!docs50-58.menta.NET!not-for-mail
From: David <d.aguilar@menta.net>
Newsgroups: es.comp.os.linux.programacion
Subject: email y php
Date: Mon, 02 Sep 2002 22:02:55 +0200
Lines: 143
Message-ID: <3D73C3EF.57F7431E@menta.net>
NNTP-Posting-Host: docs50-58.menta.net (62.57.49.58)
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: fu-berlin.de 1030997080 56561075 62.57.49.58 (16 [140324])
X-Mailer: Mozilla 4.5 [es]C-CCK-MCD KTL23  (Win98; I)
X-Accept-Language: es,en