Results 1 to 5 of 5

Thread: php mail errors

  1. #1
    Join Date
    Jan 2007
    Posts
    688

    php mail errors

    I have someone complaining that his php mail script is not working the way it should. The source code is below:


    Code:
    <title>Umboora</title>
    <table width="388" border=0 cellpadding="0" cellspacing="0">
      <form name="f1" method="post" action="WLforms.php">
      <tr>
      <td width="81" height="25" valign="top">Nombre.</td>
      <td width="307" valign="top"><input name="nombre" type="text" id="nombre" /></td></tr>
      <tr>
        <td height="25" valign="top">E-Mail.</td>
        <td valign="top"><input name="correo" type="text" id="correo" /></td>
      </tr>
      <tr>
        <td height="25" valign="top">Tel&eacute;fono.</td>
        <td valign="top"><input name="telefono" type="text" id="telefono" /></td>
      </tr>
      <tr>
        <td height="25" valign="top">Celular.</td>
        <td valign="top"><input name="celular" type="text" id="celular" /></td>
      </tr>
      <tr>
        <td height="25" valign="top">Edad.</td>
        <td valign="top"><select name="edad" id="edad">
          <option value="10">10</option>
    	  <option value="11">11</option>
    	  <option value="12">12</option>
    	  <option value="13">13</option>
    	  <option value="14">14</option>
    	  <option value="15">15</option>
          <option value="16">16</option>
    	  <option value="17">17</option>
    	  <option value="18">18</option>
    	  <option value="19">19</option>
    	  <option value="20">20</option>
    	  <option value="21">21</option>
          <option value="22">22</option>
    	  <option value="23">23</option>
    	  <option value="24">24</option>
    	  <option value="25">25</option>
    	  <option value="26">26</option>
    	  <option value="27">27</option>
          <option value="28">28</option>
    	  <option value="29">29</option>
    	  <option value="30">30</option>
    	  <option value="31">31</option>
    	  <option value="32">32</option>
    	  <option value="33">33</option>
          <option value="34">34</option>
    	  <option value="35">35</option>
    	  <option value="36">36</option>
    	  <option value="37">37</option>
    	  <option value="38">38</option>
    	  <option value="39">39</option>
          <option value="40">40</option>
    	  <option value="41">41</option>
    	  <option value="42">42</option>
    	  <option value="43">43</option>
    	  <option value="44">44</option>
    	  <option value="45">45</option>
          <option value="46">46</option>
    	  <option value="47">47</option>
    	  <option value="48">48</option>
    	  <option value="49">49</option>
    	  <option value="50">50</option>
    	  <option value="51">51</option>
          <option value="52">52</option>
    	  <option value="53">53</option>
    	  <option value="54">54</option>
    	  <option value="55">55</option>
    	  <option value="56">56</option>
    	  <option value="57">57</option>
          <option value="58">58</option>
    	  <option value="59">59</option>
    	  <option value="60">60</option>
    	  <option value="61">61</option>
    	  <option value="62">62</option>
    	  <option value="62">62</option>
          <option value="63">63</option>
    	  <option value="64">64</option>
    	  <option value="65">65</option>
    	  <option value="66">66</option>
    	  <option value="67">67</option>
    	  <option value="68">68</option>
    	  <option value="69">69</option>
    	  <option value="70">70</option>
    	  <option value="71">71</option>
          <option value="72">72</option>
    	  <option value="73">73</option>
    	  <option value="74">74</option>
    	  <option value="75">75</option>
    	  <option value="76">76</option>
    	  <option value="77">77</option>
          <option value="78">78</option>
    	  <option value="79">79</option>
    	  <option value="80">80</option>
    	  <option value="81">81</option>
          <option value="82">82</option>
    	  <option value="83">83</option>
    	  <option value="84">84</option>
    	  <option value="85">85</option>
    	  <option value="86">86</option>
    	  <option value="87">87</option>
          <option value="88">88</option>
    	  <option value="89">89</option>
    	  <option value="90">90</option>
        </select>
        </td>
      </tr>
      <tr>
        <td height="25" valign="top">Sexo.</td>
        <td valign="top"><input name="sexo" type="radio" value="Masculino" />
        Masculino
        <input name="sexo" type="radio" value="Femenino" />
        Femenino</td>
      </tr>
      
      <tr>
        <td height="25" valign="top">Pais.</td>
        <td valign="top"><select name="pais" id="pais">
          <option>Colombia</option>
        </select>    </td>
      </tr>
      <tr>
        <td height="25" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td rowspan="2" valign="top"><textarea name="comentario" cols="30" rows="5" id="comentario"></textarea></td>
      </tr>
      <tr>
        <td height="95">&nbsp;</td>
      </tr>
      <tr>
        <td height="50"></td>
        <td valign="middle"><input name="submit" type=submit value='Enviar' /></td>
      </tr></form>
    </table>
    The wlforms.php file is this

    Code:
    <?php
    $asuntoCliente = "Umboora";
    $asuntoUsuario = "Umboora";
    $correoCliente = "[email protected]";
    $correoUsuario = $_POST["correo"];
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <table width="329" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" align="center">
            <!--DWLayoutTable-->
            <tr>
              <td width="329" height="179" align="center" valign="middle"><p class="normal">Su mensaje ha sido enviado correctamente Gracias. </p>            <p> <span class="normal2$
                <?
    $usuario = "Estimado(a) $_POST[nombre], \n\nSu mensaje se ha recibido correctamente, \n
    pronto estaremos en contacto, \n\nGracias,\n\n
    Cordialmente,\n\n
    Umboora.\n";
    
    $cliente = "------ Comentario ------\n\n
    Nombre : $_POST[nombre]\n
    Correo : $_POST[correo]\n
    Telefono : $_POST[telefono]\n
    Celular : $_POST[celular]\n
    Edad : $_POST[edad]\n
    Sexo : $_POST[sexo]\n
    Pais : $_POST[pais]\n
    Comentario : $_POST[comentario]";
    
    //Function MAIL
    mail("$correoUsuario", "$asuntoUsuario",$usuario, "From: $correoCliente");
    mail("$correoCliente","$asuntoCliente",$cliente, "From: $correoUsuario");
    //echo "<meta http-equiv=refresh content=0;URL=index.html>";
    echo $correoUsuario;
    ?>
              </strong></span></p></td>
            </tr>
            <!--DWLayoutTable-->
        </table>
    </body>
    </html>
    The server is using php 4.4.8, suphp, on Centos 4

    Apache error logs shows nothing. Using the form gives off the proper thank you message, but nothing goes through it seems.

  2. #2
    Join Date
    Jan 2007
    Posts
    688
    php -m

    [PHP Modules]
    bcmath
    calendar
    ctype
    curl
    domxml
    eAccelerator
    exif
    ftp
    gd
    ionCube Loader
    mbstring
    mcrypt
    mysql
    openssl
    overload
    pcre
    pdf
    pgsql
    posix
    pspell
    session
    sockets
    standard
    tokenizer
    xml
    xmlrpc
    Zend Optimizer
    zlib

    [Zend Modules]
    Zend Extension Manager
    Zend Optimizer
    the ionCube PHP Loader

  3. #3
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    8,910
    Quote Originally Posted by Calibaba View Post
    Apache error logs shows nothing. Using the form gives off the proper thank you message, but nothing goes through it seems.
    What about the Exim logs? Try to send a message using the PHP form while running the following command:

    tail -f /var/log/exim/main_log

    (I think that's the correct path for Linux servers...)
    Patrick William | RACK911 Labs | Software Security Auditing
    400+ Vulnerabilities Found - Quote @ https://www.RACK911Labs.com

    www.HostingSecList.com - Security notices for the hosting community.

  4. #4
    Join Date
    Jan 2007
    Posts
    688
    I had done that, but the exim logs show nothing

  5. #5
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    8,910
    I just tested it on a server and it's working fine. Can you check your php.ini file and see if the mail() function is disabled?

    php -i | grep "Loaded Configuration File"

    The command above should give you the correct path to your php.ini file.
    Patrick William | RACK911 Labs | Software Security Auditing
    400+ Vulnerabilities Found - Quote @ https://www.RACK911Labs.com

    www.HostingSecList.com - Security notices for the hosting community.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •