Contact Us page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nomad
    Recognized Expert Contributor
    • Mar 2007
    • 664

    Contact Us page

    Hello everyone:
    I have a question about php script.
    When a user fills out a small contact us page and we receive it from G-mail and we open the e-mail. In the header section we get James.Smith@net solhost.com
    is there away to get rid of @netsolhost.com and just have his name. We have your hosting service with netsolutions.


    Here is my script
    Code:
    <?
    
    if(isset($_POST['email'])) {
          
    	$email_to = "dwong@lightlaboratory.com" ;
    	$from = $_POST["Your_name"];
        $email_subject = "Web Support Inquiry";   
    
        if(!isset($_POST['comments']) ||
            !isset($_POST['Your_name']) ||
            !isset($_POST['email'])) //{
            died('We are sorry, but there appears to be a problem with the form you submitted.');      
       // }
              
      $comments = $_POST['comments']; 
      $Your_name = $_POST['Your_name']; 
      $email = $_POST['email']; 
    
        $email_message = "Web Support Inquiry.\n\n";
         
        function clean_string($string) {
          $bad = array("content-type","bcc:","to:","cc:","href");
          return str_replace($bad,"",$string);
        }
        $email_message .= "Comments:    ".clean_string($comments)."\n";
        $email_message .= "Name:    ".clean_string($Your_name)."\n";
        $email_message .= "Email:      ".clean_string($email)."\n";
        
    $headers = 'From: '.$Your_name."\r\n".
    
    'Reply-To: '.$email_from."\r\n" .
    'X-Mailer: PHP/' . phpversion();
    
    @mail($email_to, $email_subject, $email_message, $headers); 
      header( 'Location: http://www.abc/thank_you.html' ) ;
    ?>
    Please see attached file for a better understanding.
    Any help would be great.
    _damon
    Attached Files
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    In the header section we get James.Smith@net solhost.com
    is there away to get rid of @netsolhost.com and just have his name.
    is this the requestor address? what if the address does not contain a meaningful name?

    Comment

    • nomad
      Recognized Expert Contributor
      • Mar 2007
      • 664

      #3
      Hello Dormilich:
      If I don't add a header then I get a bunch of numbers with @netsolhost.com

      Any ideals?
      _damon

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        Any ideals?
        quite some, but that would be off topic. ;)

        If I don't add a header then I get a bunch of numbers with @netsolhost.com
        question: where does this email address come from?

        Comment

        • nomad
          Recognized Expert Contributor
          • Mar 2007
          • 664

          #5
          From your website, hosting site is netsolutions
          which then goto to your g-mail account.

          _damon

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            that doesn’t answer the question.

            fact remains that you have to use an email address in any case. and since you don’t have any post-processing (after the email was send) you have to live with what gmail offers you.

            Comment

            • nomad
              Recognized Expert Contributor
              • Mar 2007
              • 664

              #7
              Dormilich:
              Is there away round this?
              _damon

              Comment

              • Dormilich
                Recognized Expert Expert
                • Aug 2008
                • 8694

                #8
                you could try John Smith <John.Smith@net solhost.com> (IIRC).

                mailing libraries like SwiftMailer make it easy to pass name and email.

                Comment

                Working...