Loading ...
Sorry, an error occurred while loading the content.

Feedback Form problem...

Expand Messages
  • syed rahman
    please anybody help me..I wrote php feedback form ......but there is some problem.... when anybody submit this from ...then it will show the nobody in the
    Message 1 of 4 , Jul 3, 2007
    • 0 Attachment
      please anybody help me..I wrote php feedback form ......but there is some problem....
       
      when anybody submit this from ...then it will show the "nobody" in the "from box" ...i will provide the email message in the following
      To:srajib_2003@...
      Subject:info
      From:"Nobody" <nobody@...>  
      Date:Tue, 03 Jul 2007 05:29:24 -0500


             Name: rajib 
        
      Company Name: tqi 
        
      Address: sdfsds

              Email: rajib@... 

              Message: test
      ====================================================
       
      I used two php file for this ....please check it....and give me solution as soon as possible...
       
      Contact.php
       
      <?php

      // the file which contains the contact class
      include './class.php';
      // create an instance of the contact object
      $act = new contact;
      // has the user pressed the send button on the form?
      if( $_POST['send'] )
      {  // security! strip html and bad characters.
         $name = htmlentities( $_POST['name'] );
        
         $companyname = htmlentities( $_POST['companyname'] );
        
         $address = htmlentities( $_POST['address'] );
         $email = htmlentities( $_POST['email'] );
         $message = htmlentities( $_POST['message'] );
         if( !$name ) // has the user entered a name on the form?
         {
             $error_field = 'name';
             $act->do_error( $error_field, $name, $companyname, $address,$email, $message );
         }
        
            elseif( !$companyname ) // has the user entered a message on the form?
         {
             $error_field = 'companyname';
             $act->do_error( $error_field, $name, $companyname,$address, $email, $message );
         }
        
               elseif( !$address ) // has the user entered a message on the form?
         {
             $error_field = 'address';
             $act->do_error( $error_field, $name, $companyname,$address, $email, $message );
         }
        
         elseif( !$message ) // has the user entered a message on the form?
         {
             $error_field = 'message';
             $act->do_error( $error_field, $name, $companyname,$address, $email, $message );
         }
         elseif( $name && $message && companyname && address ) // both name and message have been entered, send the email!
         {
             $act->send_mail( $name, $companyname,$address, $email, $message );
         }
      }
      else
      {
         // default action, show the contact form
         // stops people taking advantage of register_globals, always define every variable
         $error = '';
         $error_field = '';
         $name = '';
        
         $companyname='';
        
         $address = '';
         $email = '';
         $message = '';
         $act->do_form( $error, $error_field, $name, $companyname, $address, $email, $message );
      }
      ?>
       
      Class.php
       
       
      <?php
      class contact
      {
         function do_form($error, $error_field, $name,$companyname,$address , $email, $message)
         {
             // the main email form
             ?>
             <?php echo $error; /* if there is an error, print it above the form! */ ?>
             <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
      <fieldset>
      <legend>Feedback Form</legend> 
                 <table>
                     <tr>
                         <td width="116"><font color="#000000" size="2" face="tahoma" >Name:</font></td>
                       
                         <td width="192"><input type="text" name="name" value="<?php echo $name; ?>" /></td>
          
                     </tr>
           
               <tr>
                         <td><font color="#000000" face="Tahoma" size="2">Company Name: </font></td>
                         <td><input type="text" name="companyname" value="<?php echo $companyname; ?>" /></td>
                     </tr>
           
               <tr>
                         <td><font color="#000000" face="Tahoma" size="2">Address:</font></td>
                         <td><textarea name="address" rows="5" cols="20"><?php echo $address; ?></textarea></td>
                     </tr>
           
           
            <tr>
                         <td><font color="#000000" face="Tahoma" size="2">Email:</font></td>
                         <td><input type="text" name="email" value="<?php echo $email; ?>" /></td>
                     </tr>
           
           
            <tr>
                         <td ><font color="#000000" face="Tahoma" size="2">Message:</font></td>
                    
                         <td ><textarea name="message" rows="5" cols="20"><?php echo $message; ?></textarea></td>
                     </tr><tr>
                         <td colspan="2" align="center"><input type="submit" name="send" value="Send" /></td>
                     </tr>
                 </table>
      </fieldset>
             </form>
             <?
         }
       
         function do_error( $error_field, $name, $companyname,$address,  $email, $message )
         {
             // print the error, $error_field will be passed from the if else bit below
            // $error = '<p>Error, you never filled in the '' . $error_field . '' field.</p>';
          $this->do_form($error, $error_field, $name, $companyname,$address, $email, $message); // show the form, but this time have the error there too!
         }
       
         function send_mail($name,$companyname ,$address,$email, $message)
         {
             $mailto = 'srajib_2003@...'; // the email address the form will send mail to.
             $subject = 'info'; // the email subject line.

             // send the email...
       
             $message =  nl2br( $message );
             $hostname = $_SERVER['HTTP_USER_AGENT'];
             $ip = $_SERVER['REMOTE_ADDR'];
       
             mail($mailto,$subject,stripslashes("
              Name: $name 
          
       Company Name: $companyname 
          
       Address: $address
              Email: $email 
              Message: $message"),
                 "MIME-Version: 1.0nContent-type: text/html; charset=iso-8859-1nFrom: <$email> nReply-To: $email n"
             );
             ?>
             <h3><font color="#000000" face="Tahoma">The following message has been sent:-</font></h3>
                 <p>
                    <font color="#000000" face="Tahoma" size="2">Name:</font><font color="#000000" face="Arial, Helvetica, sans-serif" size="2"><?php echo $name; ?></font><br />
                      
         <font color="#000000" face="Tahoma" size="2">Company Name: <?php echo $companyname; ?></font><br />
          
          <font color="#000000" face="Tahoma" size="2">Address:<?php echo $address; ?></font><br />
                    
            <font color="#000000" face="Tahoma" size="2">Email: <?php echo $email; ?></font>       </p>
                 <p>
                 <font color="#000000" face="Tahoma" size="2"> Message:<br />
                     <?php echo $message; ?></font>
                 </p>
             <?php
         }
      }
       
      ?>
       
       
       

        


      Need a vacation? Get great deals to amazing places on Yahoo! Travel.
    • Subson Mittal
      You have not used Headers in the mail function where you have to define the From name :, and from email address . check the php manual for complete mail
      Message 2 of 4 , Jul 3, 2007
      • 0 Attachment
        You have not used Headers in the mail function where you have to define the From name :, and from email address .

        check the php manual for complete mail function and example where from headers are also sent.

        Thanks

        Subson Mittal
        LAMP Programmer

        syed rahman <srajib_2003@...> wrote:
        please anybody help me..I wrote php feedback form ......but there is some problem....
         
        when anybody submit this from ...then it will show the "nobody" in the "from box" ...i will provide the email message in the following
        To:srajib_2003@ yahoo.com
        Subject:info
        From:"Nobody" <nobody@server1. mplsmusic. com>  
        Date:Tue, 03 Jul 2007 05:29:24 -0500


               Name: rajib 
          
        Company Name: tqi 
          
        Address: sdfsds

                Email: rajib@gmail. com 

                Message: test
        ============ ========= ========= ========= ========= ====
         
        I used two php file for this ....please check it....and give me solution as soon as possible...
         
        Contact.php
         
        <?php

        // the file which contains the contact class
        include './class.php' ;
        // create an instance of the contact object
        $act = new contact;
        // has the user pressed the send button on the form?
        if( $_POST['send' ] )
        {  // security! strip html and bad characters.
           $name = htmlentities( $_POST['name' ] );
          
           $companyname = htmlentities( $_POST['companyname '] );
          
           $address = htmlentities( $_POST['address' ] );
           $email = htmlentities( $_POST['email' ] );
           $message = htmlentities( $_POST['message' ] );
           if( !$name ) // has the user entered a name on the form?
           {
               $error_field = 'name';
               $act->do_error( $error_field, $name, $companyname, $address,$email, $message );
           }
          
              elseif( !$companyname ) // has the user entered a message on the form?
           {
               $error_field = 'companyname' ;
               $act->do_error( $error_field, $name, $companyname, $address, $email, $message );
           }
          
                 elseif( !$address ) // has the user entered a message on the form?
           {
               $error_field = 'address';
               $act->do_error( $error_field, $name, $companyname, $address, $email, $message );
           }
          
           elseif( !$message ) // has the user entered a message on the form?
           {
               $error_field = 'message';
               $act->do_error( $error_field, $name, $companyname, $address, $email, $message );
           }
           elseif( $name && $message && companyname && address ) // both name and message have been entered, send the email!
           {
               $act->send_mail( $name, $companyname, $address, $email, $message );
           }
        }
        else
        {
           // default action, show the contact form
           // stops people taking advantage of register_globals, always define every variable
           $error = '';
           $error_field = '';
           $name = '';
          
           $companyname= '';
          
           $address = '';
           $email = '';
           $message = '';
           $act->do_form( $error, $error_field, $name, $companyname, $address, $email, $message );
        }
        ?>
         
        Class.php
         
         
        <?php
        class contact
        {
           function do_form($error, $error_field, $name,$companyname, $address , $email, $message)
           {
               // the main email form
               ?>
               <?php echo $error; /* if there is an error, print it above the form! */ ?>
               <form action="<?php echo $_SERVER['PHP_ SELF']?>" method="post">
        <fieldset>
        <legend>Feedback Form</legend> 
                   <table>
                       <tr>
                           <td width="116"><font color="#000000" size="2" face="tahoma" >Name:</font></td>
                         
                           <td width="192"><input type="text" name="name" value="<?php echo $name; ?>" /></td>
            
                       </tr>
             
                 <tr>
                           <td><font color="#000000" face="Tahoma" size="2">Company Name: </font></td>
                           <td><input type="text" name="companyname" value="<?php echo $companyname; ?>" /></td>
                       </tr>
             
                 <tr>
                           <td><font color="#000000" face="Tahoma" size="2">Address:</font></td>
                           <td><textarea name="address" rows="5" cols="20"><?php echo $address; ?></textarea></td>
                       </tr>
             
             
              <tr>
                           <td><font color="#000000" face="Tahoma" size="2">Email:</font></td>
                           <td><input type="text" name="email" value="<?php echo $email; ?>" /></td>
                       </tr>
             
             
              <tr>
                           <td ><font color="#000000" face="Tahoma" size="2">Message:</font></td>
                      
                           <td ><textarea name="message" rows="5" cols="20"><?php echo $message; ?></textarea></td>
                       </tr><tr>
                           <td colspan="2" align="center"><input type="submit" name="send" value="Send" /></td>
                       </tr>
                   </table>
        </fieldset>
               </form>
               <?
           }
         
           function do_error( $error_field, $name, $companyname, $address,  $email, $message )
           {
               // print the error, $error_field will be passed from the if else bit below
              // $error = '<p>Error, you never filled in the '' . $error_field . '' field.</p>';
            $this->do_form($error, $error_field, $name, $companyname, $address, $email, $message); // show the form, but this time have the error there too!
           }
         
           function send_mail($name, $companyname ,$address,$email, $message)
           {
               $mailto = 'srajib_2003@ yahoo.com'; // the email address the form will send mail to.
               $subject = 'info'; // the email subject line.

               // send the email...
         
               $message =  nl2br( $message );
               $hostname = $_SERVER['HTTP_ USER_AGENT' ];
               $ip = $_SERVER['REMOTE_ ADDR'];
         
               mail($mailto, $subject, stripslashes( "
                Name: $name 
            
         Company Name: $companyname 
            
         Address: $address
                Email: $email 
                Message: $message"),
                   "MIME-Version: 1.0nContent- type: text/html; charset=iso- 8859-1nFrom: <$email> nReply-To: $email n"
               );
               ?>
               <h3><font color="#000000" face="Tahoma">The following message has been sent:-</font></h3>
                   <p>
                      <font color="#000000" face="Tahoma" size="2">Name:</font><font color="#000000" face="Arial, Helvetica, sans-serif" size="2"><?php echo $name; ?></font><br />
                        
           <font color="#000000" face="Tahoma" size="2">Company Name: <?php echo $companyname; ?></font><br />
            
            <font color="#000000" face="Tahoma" size="2">Address:<?php echo $address; ?></font><br />
                      
              <font color="#000000" face="Tahoma" size="2">Email: <?php echo $email; ?></font>       </p>
                   <p>
                   <font color="#000000" face="Tahoma" size="2"> Message:<br />
                       <?php echo $message; ?></font>
                   </p>
               <?php
           }
        }
         
        ?>
         
         
         

          

        Need a vacation? Get great deals to amazing places on Yahoo! Travel.

      • syed rahman
        thank you for your reply. please give me the idea where i can put this header ..... Rajib Rahman Subson Mittal wrote: You have not
        Message 3 of 4 , Jul 4, 2007
        • 0 Attachment
          thank you for your reply.
          please give me the idea where i can put this header .....
           
          Rajib Rahman

          Subson Mittal <subsonmittal@...> wrote:
          You have not used Headers in the mail function where you have to define the From name :, and from email address .

          check the php manual for complete mail function and example where from headers are also sent.

          Thanks

          Subson Mittal
          LAMP Programmer

          syed rahman <srajib_2003@ yahoo.com> wrote:
          please anybody help me..I wrote php feedback form ......but there is some problem....
           
          when anybody submit this from ...then it will show the "nobody" in the "from box" ...i will provide the email message in the following
          To:srajib_2003@ yahoo.com
          Subject:info
          From:"Nobody" <nobody@server1. mplsmusic. com>  
          Date:Tue, 03 Jul 2007 05:29:24 -0500


                 Name: rajib 
            
          Company Name: tqi 
            
          Address: sdfsds

                  Email: rajib@gmail. com 

                  Message: test
          ============ ========= ========= ========= ========= ====
           
          I used two php file for this ....please check it....and give me solution as soon as possible...
           
          Contact.php
           
          <?php

          // the file which contains the contact class
          include './class.php' ;
          // create an instance of the contact object
          $act = new contact;
          // has the user pressed the send button on the form?
          if( $_POST['send' ] )
          {  // security! strip html and bad characters.
             $name = htmlentities( $_POST['name' ] );
            
             $companyname = htmlentities( $_POST['companyname '] );
            
             $address = htmlentities( $_POST['address' ] );
             $email = htmlentities( $_POST['email' ] );
             $message = htmlentities( $_POST['message' ] );
             if( !$name ) // has the user entered a name on the form?
             {
                 $error_field = 'name';
                 $act->do_error( $error_field, $name, $companyname, $address,$email, $message );
             }
            
                elseif( !$companyname ) // has the user entered a message on the form?
             {
                 $error_field = 'companyname' ;
                 $act->do_error( $error_field, $name, $companyname, $address, $email, $message );
             }
            
                   elseif( !$address ) // has the user entered a message on the form?
             {
                 $error_field = 'address';
                 $act->do_error( $error_field, $name, $companyname, $address, $email, $message );
             }
            
             elseif( !$message ) // has the user entered a message on the form?
             {
                 $error_field = 'message';
                 $act->do_error( $error_field, $name, $companyname, $address, $email, $message );
             }
             elseif( $name && $message && companyname && address ) // both name and message have been entered, send the email!
             {
                 $act->send_mail( $name, $companyname, $address, $email, $message );
             }
          }
          else
          {
             // default action, show the contact form
             // stops people taking advantage of register_globals, always define every variable
             $error = '';
             $error_field = '';
             $name = '';
            
             $companyname= '';
            
             $address = '';
             $email = '';
             $message = '';
             $act->do_form( $error, $error_field, $name, $companyname, $address, $email, $message );
          }
          ?>
           
          Class.php
           
           
          <?php
          class contact
          {
             function do_form($error, $error_field, $name,$companyname, $address , $email, $message)
             {
                 // the main email form
                 ?>
                 <?php echo $error; /* if there is an error, print it above the form! */ ?>
                 <form action="<?php echo $_SERVER['PHP_ SELF']?>" method="post">
          <fieldset>
          <legend>Feedback Form</legend> 
                     <table>
                         <tr>
                             <td width="116"><font color="#000000" size="2" face="tahoma" >Name:</font></td>
                           
                             <td width="192"><input type="text" name="name" value="<?php echo $name; ?>" /></td>
              
                         </tr>
               
                   <tr>
                             <td><font color="#000000" face="Tahoma" size="2">Company Name: </font></td>
                             <td><input type="text" name="companyname" value="<?php echo $companyname; ?>" /></td>
                         </tr>
               
                   <tr>
                             <td><font color="#000000" face="Tahoma" size="2">Address:</font></td>
                             <td><textarea name="address" rows="5" cols="20"><?php echo $address; ?></textarea></td>
                         </tr>
               
               
                <tr>
                             <td><font color="#000000" face="Tahoma" size="2">Email:</font></td>
                             <td><input type="text" name="email" value="<?php echo $email; ?>" /></td>
                         </tr>
               
               
                <tr>
                             <td ><font color="#000000" face="Tahoma" size="2">Message:</font></td>
                        
                             <td ><textarea name="message" rows="5" cols="20"><?php echo $message; ?></textarea></td>
                         </tr><tr>
                             <td colspan="2" align="center"><input type="submit" name="send" value="Send" /></td>
                         </tr>
                     </table>
          </fieldset>
                 </form>
                 <?
             }
           
             function do_error( $error_field, $name, $companyname, $address,  $email, $message )
             {
                 // print the error, $error_field will be passed from the if else bit below
                // $error = '<p>Error, you never filled in the '' . $error_field . '' field.</p>';
              $this->do_form($error, $error_field, $name, $companyname, $address, $email, $message); // show the form, but this time have the error there too!
             }
           
             function send_mail($name, $companyname ,$address,$email, $message)
             {
                 $mailto = 'srajib_2003@ yahoo.com'; // the email address the form will send mail to.
                 $subject = 'info'; // the email subject line.

                 // send the email...
           
                 $message =  nl2br( $message );
                 $hostname = $_SERVER['HTTP_ USER_AGENT' ];
                 $ip = $_SERVER['REMOTE_ ADDR'];
           
                 mail($mailto, $subject, stripslashes( "
                  Name: $name 
              
           Company Name: $companyname 
              
           Address: $address
                  Email: $email 
                  Message: $message"),
                     "MIME-Version: 1.0nContent- type: text/html; charset=iso- 8859-1nFrom: <$email> nReply-To: $email n"
                 );
                 ?>
                 <h3><font color="#000000" face="Tahoma">The following message has been sent:-</font></h3>
                     <p>
                        <font color="#000000" face="Tahoma" size="2">Name:</font><font color="#000000" face="Arial, Helvetica, sans-serif" size="2"><?php echo $name; ?></font><br />
                          
             <font color="#000000" face="Tahoma" size="2">Company Name: <?php echo $companyname; ?></font><br />
              
              <font color="#000000" face="Tahoma" size="2">Address:<?php echo $address; ?></font><br />
                        
                <font color="#000000" face="Tahoma" size="2">Email: <?php echo $email; ?></font>       </p>
                     <p>
                     <font color="#000000" face="Tahoma" size="2"> Message:<br />
                         <?php echo $message; ?></font>
                     </p>
                 <?php
             }
          }
           
          ?>
           
           
           

            

          Need a vacation? Get great deals to amazing places on Yahoo! Travel.



          Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when.

        • Subson Mittal
          Message 4 of 4 , Jul 4, 2007
          • 0 Attachment
            <?php
            $to      
            'nobody@...';
            $subject 'the subject';
            $message 'hello';
            $headers = 'From: webmaster@...' . "\r\n" .
                'Reply-To: webmaster@...' . "\r\n" .
                'X-Mailer: PHP/' . phpversion
            ();

            mail($to$subject$message$headers);
            ?>


            syed rahman <srajib_2003@...> wrote:
            thank you for your reply.
            please give me the idea where i can put this header .....
             
            Rajib Rahman

            Subson Mittal <subsonmittal@ yahoo.com> wrote:
            You have not used Headers in the mail function where you have to define the From name :, and from email address .

            check the php manual for complete mail function and example where from headers are also sent.

            Thanks

            Subson Mittal
            LAMP Programmer

            syed rahman <srajib_2003@ yahoo.com> wrote:
            please anybody help me..I wrote php feedback form ......but there is some problem....
             
            when anybody submit this from ...then it will show the "nobody" in the "from box" ...i will provide the email message in the following
            To:srajib_2003@ yahoo.com
            Subject:info
            From:"Nobody" <nobody@server1. mplsmusic. com>  
            Date:Tue, 03 Jul 2007 05:29:24 -0500


                   Name: rajib 
              
            Company Name: tqi 
              
            Address: sdfsds

                    Email: rajib@gmail. com 

                    Message: test
            ============ ========= ========= ========= ========= ====
             
            I used two php file for this ....please check it....and give me solution as soon as possible...
             
            Contact.php
             
            <?php

            // the file which contains the contact class
            include './class.php' ;
            // create an instance of the contact object
            $act = new contact;
            // has the user pressed the send button on the form?
            if( $_POST['send' ] )
            {  // security! strip html and bad characters.
               $name = htmlentities( $_POST['name' ] );
              
               $companyname = htmlentities( $_POST['companyname '] );
              
               $address = htmlentities( $_POST['address' ] );
               $email = htmlentities( $_POST['email' ] );
               $message = htmlentities( $_POST['message' ] );
               if( !$name ) // has the user entered a name on the form?
               {
                   $error_field = 'name';
                   $act->do_error( $error_field, $name, $companyname, $address,$email, $message );
               }
              
                  elseif( !$companyname ) // has the user entered a message on the form?
               {
                   $error_field = 'companyname' ;
                   $act->do_error( $error_field, $name, $companyname, $address, $email, $message );
               }
              
                     elseif( !$address ) // has the user entered a message on the form?
               {
                   $error_field = 'address';
                   $act->do_error( $error_field, $name, $companyname, $address, $email, $message );
               }
              
               elseif( !$message ) // has the user entered a message on the form?
               {
                   $error_field = 'message';
                   $act->do_error( $error_field, $name, $companyname, $address, $email, $message );
               }
               elseif( $name && $message && companyname && address ) // both name and message have been entered, send the email!
               {
                   $act->send_mail( $name, $companyname, $address, $email, $message );
               }
            }
            else
            {
               // default action, show the contact form
               // stops people taking advantage of register_globals, always define every variable
               $error = '';
               $error_field = '';
               $name = '';
              
               $companyname= '';
              
               $address = '';
               $email = '';
               $message = '';
               $act->do_form( $error, $error_field, $name, $companyname, $address, $email, $message );
            }
            ?>
             
            Class.php
             
             
            <?php
            class contact
            {
               function do_form($error, $error_field, $name,$companyname, $address , $email, $message)
               {
                   // the main email form
                   ?>
                   <?php echo $error; /* if there is an error, print it above the form! */ ?>
                   <form action="<?php echo $_SERVER['PHP_ SELF']?>" method="post">
            <fieldset>
            <legend>Feedback Form</legend> 
                       <table>
                           <tr>
                               <td width="116"><font color="#000000" size="2" face="tahoma" >Name:</font></td>
                             
                               <td width="192"><input type="text" name="name" value="<?php echo $name; ?>" /></td>
                
                           </tr>
                 
                     <tr>
                               <td><font color="#000000" face="Tahoma" size="2">Company Name: </font></td>
                               <td><input type="text" name="companyname" value="<?php echo $companyname; ?>" /></td>
                           </tr>
                 
                     <tr>
                               <td><font color="#000000" face="Tahoma" size="2">Address:</font></td>
                               <td><textarea name="address" rows="5" cols="20"><?php echo $address; ?></textarea></td>
                           </tr>
                 
                 
                  <tr>
                               <td><font color="#000000" face="Tahoma" size="2">Email:</font></td>
                               <td><input type="text" name="email" value="<?php echo $email; ?>" /></td>
                           </tr>
                 
                 
                  <tr>
                               <td ><font color="#000000" face="Tahoma" size="2">Message:</font></td>
                          
                               <td ><textarea name="message" rows="5" cols="20"><?php echo $message; ?></textarea></td>
                           </tr><tr>
                               <td colspan="2" align="center"><input type="submit" name="send" value="Send" /></td>
                           </tr>
                       </table>
            </fieldset>
                   </form>
                   <?
               }
             
               function do_error( $error_field, $name, $companyname, $address,  $email, $message )
               {
                   // print the error, $error_field will be passed from the if else bit below
                  // $error = '<p>Error, you never filled in the '' . $error_field . '' field.</p>';
                $this->do_form($error, $error_field, $name, $companyname, $address, $email, $message); // show the form, but this time have the error there too!
               }
             
               function send_mail($name, $companyname ,$address,$email, $message)
               {
                   $mailto = 'srajib_2003@ yahoo.com'; // the email address the form will send mail to.
                   $subject = 'info'; // the email subject line.

                   // send the email...
             
                   $message =  nl2br( $message );
                   $hostname = $_SERVER['HTTP_ USER_AGENT' ];
                   $ip = $_SERVER['REMOTE_ ADDR'];
             
                   mail($mailto, $subject, stripslashes( "
                    Name: $name 
                
             Company Name: $companyname 
                
             Address: $address
                    Email: $email 
                    Message: $message"),
                       "MIME-Version: 1.0nContent- type: text/html; charset=iso- 8859-1nFrom: <$email> nReply-To: $email n"
                   );
                   ?>
                   <h3><font color="#000000" face="Tahoma">The following message has been sent:-</font></h3>
                       <p>
                          <font color="#000000" face="Tahoma" size="2">Name:</font><font color="#000000" face="Arial, Helvetica, sans-serif" size="2"><?php echo $name; ?></font><br />
                            
               <font color="#000000" face="Tahoma" size="2">Company Name: <?php echo $companyname; ?></font><br />
                
                <font color="#000000" face="Tahoma" size="2">Address:<?php echo $address; ?></font><br />
                          
                  <font color="#000000" face="Tahoma" size="2">Email: <?php echo $email; ?></font>       </p>
                       <p>
                       <font color="#000000" face="Tahoma" size="2"> Message:<br />
                           <?php echo $message; ?></font>
                       </p>
                   <?php
               }
            }
             
            ?>
             
             
             

              

            Need a vacation? Get great deals to amazing places on Yahoo! Travel.



            Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when.

          Your message has been successfully submitted and would be delivered to recipients shortly.