Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 25
  1. #1
    Senior Member -chris-'s Avatar
    Join Date
    Apr 2006
    Location
    SK
    Posts
    1,205
    Member #
    13102
    A client sent me an email saying that someone had contacted them using the form (one of the half dozen they have ), and the email address comes up as apache [at] **.blacksun.ca. Blacksun.ca being their host.

    I copied the form from my site (which works perfectly) and put it on his site, and it doesn't work at all. I am using a modified/extended version of the form that filburt1 provided here at WDF.

    PHP Code:
    <?
    if (isset($_POST['from']))
    {
        
    $ip $_SERVER['REMOTE_ADDR'];
        
    $resolved gethostbyaddr($ip);
        if (
    $resolved != $ip)
        {
            
    $footer "This e-mail was sent by a user with the IP address $ip, which resolved to '$resolved'.";
        }
        else
        {
            
    $footer "This e-mail was sent by a user with the IP address $ip, which could not be resolved to a hostname.";
        }
        
    $message $_POST['message'];
        
    $message "$name\n\n$city$state\n\n$areacode-$phonenumber-$phonenumber2\n\n$message\n\n------------\n$footer";
        
        if (
    mail('[B]MYEMAILADDRESS[/B]'$subject$message"From: $from\r\nReply-To: $from\r\n"))
        {
            echo 
    '<p class="style4" align="center">Your mail was successfully sent.</p>';
        }
        else
        {
            echo 
    '<p class="style4" align="center">There was an error while sending the mail.</p>';
        }
    }
    else
    {
    ?>
                 </p>
                   <form method="post" action="<? echo $_SERVER['PHP_SELF']; ?>">
      <p class="style1">Please be aware that your IP address (<? echo $_SERVER['REMOTE_ADDR'?>) will be sent along with the message to prevent against abuse of this mail form.</p>
        <p class="style3"><em>**All fields are required.**</em></p>
      <table border="0" align="center" cellpadding="3" cellspacing="0">
        <tr>
          <td><p class="style1">Your e-mail address:</p>
          <input type="text" name="from" size="60" />    </tr>
              <tr>
          <td><p class="style1">Name:</p>
            <input type="text" name="name" size="60" />    </tr>
        <tr>
          <td><p class="style1">Subject:</p>
          <input type="text" name="subject" size="60" />    </tr>
        <tr>    </tr>
        <tr>
          <td><p class="style1">Location:</p>
            <p class="style1">City: <input type="text" name="city" size="30" /> State/Province: <input type="text" name="state" size="5" maxlength="2" /></tr>
        <tr>
          <td><p class="style1">Phone:</p>
          <input type="text" name="areacode" size="3" maxlength="3"  /> - <input type="text" name="phonenumber" size="3" maxlength="3" /> - <input type="text" name="phonenumber2" size="5" maxlength="4" /></tr>
        <tr>
          <td><p class="style1">Message:</p>
            <textarea name="message" rows="5" cols="60"></textarea></td>
        </tr>
        <tr>
          <td align="right"><p class="style1">Click
            &quot;Send&quot; only once.</p>
            <input name="submit" type="submit" value="Send" /></td>
        </tr>
      </table>
    </form>
    <?
    }
    ?>
    Portfolio | Blog | Twitter

    Was my post, or someone elses, helpful? Click the thumbs up to let everyone know!

  2.  

  3. #2
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    It's entirely possible that there is no mail server set up to handle things on that server. Try a simple page that just sends a single email with the mail() function. Alternatively, look through your error logs and see if there's any whining coming from PHP there.

  4. #3
    Senior Member -chris-'s Avatar
    Join Date
    Apr 2006
    Location
    SK
    Posts
    1,205
    Member #
    13102
    The error logs had been turned off, and the simple php mail form came up as from Apache.
    Portfolio | Blog | Twitter

    Was my post, or someone elses, helpful? Click the thumbs up to let everyone know!

  5. #4
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    So the server that wasn't sending with that form is sending correctly with a basic page? If so, activate full error display on that page via a [minicode]error_reporting( E_ALL );[/minicode] and possibly a [minicode]ini_set( 'display_errors', true );[/minicode].

  6. #5
    Senior Member -chris-'s Avatar
    Join Date
    Apr 2006
    Location
    SK
    Posts
    1,205
    Member #
    13102
    No, it said it was it was from Apache.
    Portfolio | Blog | Twitter

    Was my post, or someone elses, helpful? Click the thumbs up to let everyone know!

  7. #6
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Wait, so it's just the From part that isn't working, or are the emails not sending at all?

  8. #7
    Senior Member -chris-'s Avatar
    Join Date
    Apr 2006
    Location
    SK
    Posts
    1,205
    Member #
    13102
    The emails are sending from both pages, just the from is missing. Both (the original, and the very basic, stripped down test page) pages list Apache [at] **.blacksun.ca as the from address.
    Portfolio | Blog | Twitter

    Was my post, or someone elses, helpful? Click the thumbs up to let everyone know!

  9. #8
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    That's the default for PHP. See the documentation for [phpfunction]mail[/phpfunction] where you can specify extra MIME headers, including a From header.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  10. #9
    Senior Member -chris-'s Avatar
    Join Date
    Apr 2006
    Location
    SK
    Posts
    1,205
    Member #
    13102
    Thanks for your help, both of you, but I changed the email address from theirs to mine to see what I got, and all that was delivered was the comma between the city and state, the hyphens, the message, and the footer. The name, city, state, areacode, phonenumber, and phonenumber2 are missing as well as the email address mentioned above.

    $message = "$name\n\n$city, $state\n\n$areacode-$phonenumber-$phonenumber2\n\n$message\n\n------------\n$footer";

    Sorry to be such a pain.
    Portfolio | Blog | Twitter

    Was my post, or someone elses, helpful? Click the thumbs up to let everyone know!

  11. #10
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Try getting rid of the Reply-To portion of the header (which is unnecessary anyway).


Page 1 of 3 1 2 3 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:22 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com