Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Contact Form not working on windows server

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #26284
    slacey
    Member

    I used Chris’ simple contact form for a website. It work absolutely fine on my server but when the client uploads it to their server, which is a windows server, its having problems. Instead of redirecting to the Success page, it redirects to the Error page but apparently the recipient is receiving emails. I don’t know why or how to stop it from redirecting to the error page, or to stop the error if that’s whats happening.

    EDIT: Correction, they are not receiving the emails, which means its not working at all.

    This is the code in the HTML

    Code:







    The contact engine

    Code:
    “;
    exit;
    }

    // prepare email body text
    $Body = “”;
    $Body .= “Name: “;
    $Body .= $Name;
    $Body .= “n”;
    $Body .= “Email: “;
    $Body .= $Email;
    $Body .= “n”;
    $Body .= “Message: “;
    $Body .= $Message;
    $Body .= “n”;

    // send email
    $success = mail($EmailTo, $Subject, $Body, “From: <$EmailFrom>“);

    // redirect to success page
    if ($success){
    print ““;
    }
    else{
    print ““;
    }

    ?>

    Chris added a mod by Toni for windows server but I’m not sure if I’m using it correctly.

    Code:
    /* Modification by Toni for Windows servers */
    ini_set(“sendmail_from”, “[email protected]”);

    Should I put it in the contact engine at the end? Also, do I replace "[email protected]" with the Send To email?

    Please help!

    #64842
    slacey
    Member

    Ok, I’m going to explain this a little more.

    I built a very simple website for a client using php includes, html, and css. Very simple. The form works fine on my development server.

    I gave it to the client to put on their own server. They’re using a Windows server. Everything except the contact form works. He’s a IT guy who knows all the server stuff but nothing about PHP or building websites. We’re trying to communicate to figure out the problem but we don’t know what the other is talking about most of the time. I asked if they use SMTP for their email and he said: "SMTP is not installed but we have an internal exchange server for our email. The websites that we have use this server to connect and send email through. I went ahead and install smtp anyways." Basically, I have no idea what this means and how to make it work.

    The code I showed in the above comment is exactly what’s on the website. I guess my main question is: What does he need to do to fix it on his end? Or what do I need to do on my end to fix it?

    Please help if you can! Thank you!

    #115312
    izzywizzy
    Member

    Please did anyone resolve this issue, I am having the same problem

    #130632
    MarkHolbrook
    Member

    Not sure if you have already sorted your issue, I have had the exact same problem and been scratching my head for days. I found a fix that works perfectly: (taken from another forum)

    Hi there,
    Fyi – I found the fix in the php manual, on a forum:

    Under windows there is a bug in php/mail
    See here: http://bugs.php.net/bug.php?id=28038
    this results in you being unable to send ‘From: Full Name ‘
    Workaround is:
    Set the following before calling the mail function:

    ini_set(‘sendmail_from’, ‘[email protected]’);

    Hope this helps

    Mark

    #130652
    Eric
    Member

    Does the form have any validation? From its demo its seems no.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Back End’ is closed to new topics and replies.