Menu

Email not working from form

Help
sbrault
2007-06-01
2013-06-03
  • sbrault

    sbrault - 2007-06-01

    I have a fellin gmy host is blocking the send function but I can not get an answer from them. I have even moved the files to another site but stillnot working. Can some help why the form is not being mailed? I have attached my phpform and the website where it is.

    http://www.quantumdatingclub.com/request.html

    <?php
    include("global.inc.php");
    $errors=0;
    $error="The following errors occured while processing your form input.<ul>";
    pt_register('POST','FullName');
    pt_register('POST','PhoneNumber');
    pt_register('POST','EmailAddress');
    pt_register('POST','Howdidyouhearaboutus');
    $Howdidyouhearaboutus=preg_replace("/(\015\012)|(\015)|(\012)/","&nbsp;<br />", $Howdidyouhearaboutus);if($FullName=="" || $PhoneNumber=="" || $EmailAddress=="" || $Howdidyouhearaboutus=="" ){
    $errors=1;
    $error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
    }
    if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$EmailAddress)){
    $error.="<li>Invalid email address entered";
    $errors=1;
    }
    if($errors==1) echo $error;
    else{
    $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
    $message="Full Name: ".$FullName."
    Phone Number: ".$PhoneNumber."
    Email Address: ".$EmailAddress."
    How did you hear about us: ".$Howdidyouhearaboutus."
    ";
    $message = stripslashes($message);
    mail("sherri@sherridesign.com","Password Request",$message,"From:http://www.quantumdatingclub.com/request.html");

    header("Refresh: 0;url=http://www.quantumdatingclub.com/thankyou.html");
    ?><?php
    }
    ?>

     
    • TNTEverett

      TNTEverett - 2007-06-02

      Try removing the URL from the "From:" section of the mail function.  This may be interpreted as spam or dangerous email.

       
      • TNTEverett

        TNTEverett - 2007-06-04

        Your change still does not follow typical "From:" syntax.  Although this field is typically not filled in on most phpFormgenerator forms, your host may apply more strict requirements. 
        First identify the following for a failing case:
        1.) The "To:" email address.
        2.) The "From:" email address, or string.

        Report these to your host along with a copy of the line in your process.php file that specifies the syntax for the mail() function.  Ask if they know of any reason why this email (mail() function) shoud fail.  Submit a form and write down the time.  Ask your host if they can identify a log (at the time recorded) that indicates that this email is sent or rejected.  Logs should be capable of reporting success or failure. 

        I can take a copy of your form and test it on my site if you still have issues. 

         
        • sbrault

          sbrault - 2007-06-04

          I have moved it to another site (sherridesign.com that has a different host) and I have no problem at all? I have done what you requested by sending a support to the other hosting company.
          sherri

           
    • sbrault

      sbrault - 2007-06-04

      Nothing changed.

      shows as this now
      $message = stripslashes($message);
      mail("sherri@sherridesign.com","Form Submitted at your website",$message,"From:Quantum Dating Club");
      ?>

      How do i see if they are blocking it.  I have this program on another site infact 3 sites and they all work fine.

      sherri

       
    • sbrault

      sbrault - 2007-06-07

      thank you everyone.
      sherri

       
    • Jattin

      Jattin - 2007-06-22

      Your Form Looks good. You probably figured it out but for people looking:

      Some web hosts block sending from any address other than one hosted at the server.

      So, to correct the problem simply make the From: info@thedomainwheretheformis.com

       
    • Rubicksman

      Rubicksman - 2007-06-22

      I'm having a problem getting my form results mailed to me.  My web host suggested the phpFormGenerator.  I don't know much about php or html.  I'll copy and paste my processor.php file here:

      <?php

      $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

      mail("rubicksman@rubicksman.com","phpFormGenerator - Form submission","Form data:

      Suggestions: " . $_POST['field_1'] . "

      powered by phpFormGenerator.
      ");

      include("confirm.html");

      ?>

      That is the entire thing.  The only thing I changed was the email because I had a gmail address in there but then I changed it to the rubicksman.com email because that is an email on my domain and I thought that the gmail address might have been the problem.  I'd appreciate some help. 

       
      • TNTEverett

        TNTEverett - 2007-06-25

        This is not much of a process.php file.  Are you using the new version 3? Some hosts or email servers are getting tough on "strange" emails.  From your example you provided it looks like there is no "From:" field.  The "From:" address should also look like a valid email address.  Try using a valid email address in the "From:" field. 

        mail("rubicksman@rubicksman.com",
             "phpFormGenerator - Form submission",
             "Form data: Suggestions: " . $_POST['field_1'] . "",
             "email@yourdomain.com");

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.