Menu

Help

Help
KBadler
2006-12-29
2013-06-03
  • KBadler

    KBadler - 2006-12-29

    Just added phpformgen and its working great, sending confirmation email to the user, as well to sending data to the appropriate email that i assigned. But, the formatting of the data on the email is not line breaking after i added the confirmation email setting. See the below code and example of output. The thank you page is working correctly, just the received emails.

    Thanks

    Email Output:

    Full Name: Test Name
    Company or Agency: Test Company
    Telephone Number: 111-111-1234
    Email Address: name@domain.com Request Type: Fire Station Tour Desired Date: 01-01-2001 Desired Time: 1100 Type of Group: children Number in Group: 11 Additional Information: xdf gdfg dfgd

    Code:
    <?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','CompanyorAgency');
    pt_register('POST','TelephoneNumber');
    pt_register('POST','EmailAddress');
    pt_register('POST','RequestType');
    pt_register('POST','DesiredDate');
    pt_register('POST','DesiredTime');
    pt_register('POST','TypeofGroup');
    pt_register('POST','NumberinGroup');
    pt_register('POST','AdditionalInformation');
    $AdditionalInformation=preg_replace("/(\015\012)|(\015)|(\012)/","&nbsp;<br />", $AdditionalInformation);if($FullName=="" || $TelephoneNumber=="" || $RequestType=="" || $DesiredDate=="" || $DesiredTime=="" || $TypeofGroup=="" || $NumberinGroup=="" ){
    $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."
    Company or Agency: ".$CompanyorAgency."
    Telephone Number: ".$TelephoneNumber."
    Email Address: ".$EmailAddress."
    Request Type: ".$RequestType."
    Desired Date: ".$DesiredDate."
    Desired Time: ".$DesiredTime."
    Type of Group: ".$TypeofGroup."
    Number in Group: ".$NumberinGroup."
    Additional Information: ".$AdditionalInformation."
    ";
    $message = stripslashes($message);
    mail("name@domain.org","Tour Request From RVFC website",$message,"From: TourRequest@domain.org");

    mail($EmailAddress,"Confirm of RVFC Email",$message,"From: TourRequest@domain.org");
    ?>

    <!-- This is the content of the Thank you page, be careful while changing it -->

    <h2>Thank you!</h2>
    <p><b><font size="5">Someone Will Be Contacting You Shortly</font></b></p>

    <table width=50%>
    <tr><td>Full Name: </td><td> <?php echo $FullName; ?> </td></tr>
    <tr><td>Company or Agency: </td><td> <?php echo $CompanyorAgency; ?> </td></tr>
    <tr><td>Telephone Number: </td><td> <?php echo $TelephoneNumber; ?> </td></tr>
    <tr><td>Email Address: </td><td> <?php echo $EmailAddress; ?> </td></tr>
    <tr><td>Request Type: </td><td> <?php echo $RequestType; ?> </td></tr>
    <tr><td>Desired Date: </td><td> <?php echo $DesiredDate; ?> </td></tr>
    <tr><td>Desired Time: </td><td> <?php echo $DesiredTime; ?> </td></tr>
    <tr><td>Type of Group: </td><td> <?php echo $TypeofGroup; ?> </td></tr>
    <tr><td>Number in Group: </td><td> <?php echo $NumberinGroup; ?> </td></tr>
    <tr><td>Additional Information: </td><td> <?php echo $AdditionalInformation; ?> </td></tr>
    </table>
    </p>
    <tr><td>Current Date and Time: </td><td><?php
    putenv('TZ=America/New_York');
    echo date("Y-m-d h:i:sa", time());
    ?>

    <!-- Do not change anything below this line -->

    <?php
    }
    ?>

     
    • Musawir Ali

      Musawir Ali - 2006-12-30

      Is your email output all in one line? The way you have it listed, it seems like the first few form fields have proper line breaks but the rest are all in one line without any breaks. Is that the case? From the code I can't really see why that would happen though. It should either be all in one line or all properly line broken.

       
      • KBadler

        KBadler - 2006-12-30

        Just as it shows below, first line has a line break and the rest is like one long line.

        Full Name: text
        Company or Agency: text Telephone Number: 111-111-1234 Email Address: test@domain.com Request Type: Fire Station Tour Desired Date: 01/11/2001 Desired Time: 1100 Type of Group: children Number in Group: 11 Additional Information: dcasdasda

         
    • Musawir Ali

      Musawir Ali - 2006-12-31

      your mail client is probably html only. try adding some br tags.

       
      • KBadler

        KBadler - 2006-12-31

        Where would i place them? I am not too sure ..

         
    • KBadler

      KBadler - 2006-12-31

      Problem Solved thanks

       

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.