Re: Contact Form Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Hi all
> 
> Got an absolutely baffling problem with a bit of code that I've been 
> using for a very long time now that I've never had a problem with until 
> now...
> 
> Here's the code:
> 
> *<?php
> $To = "djdust@xxxxxxxxxxxx";
> $Subject = "Testing";
> $Headers = "From: contact@xxxxxxxxxxxxxxxxxxxx";
> if (!isset($_POST['Email'])){ ?>
> <div id="contact_form">
> <form id="form" name="Form" method="post" action="<?php echo 
> $_SERVER['PHP_SELF']; ?>">
> <label>Name</label>
> <input type="text" name="Name" />
> <label>Email Address<em></label>
> <input type="text" name="Email" />
> <label>Message:</label>
> <textarea name="Message" rows="10" cols="10"></textarea>
> <button type="submit" name="Submit">Send!!</button>
> </form>
> </div>
> <?php
>      } else {
>          $Line1="you got the following message:";
>          $Content = "$Line1\n\nName: $_POST[Name]\n\nEmail: 
> $_POST[Email]\n\nMessage:\n\n$_POST[Message]"; 
> mail("$To","$Subject","$Content","$Headers");
>      } ?>
> *
> 
> When it runs, no email is forwarded from it.  It's always worked before 
> and, after a very long time diagnosing, I've pinpointed what the problem 
> is - it's the 4th line:
> 
> *$Headers = "From: contact@xxxxxxxxxxxxxxxxxxxx";*
> 
> Specifically, the domain name.  If I change it to *anything else* at all 
> (such as wedding.com or swindon.com), the form works and the message 
> arrives.  Keep it as it is though and the message just disappears down a 
> black hole.  This is the same domain name that the page/site is going to 
> be hosted at.  Has anyone got any idea at all why this is happening?  
> All my other websites use the same code and have their own domain name 
> in the email address and work perfectly. Why is this one single site not 
> playing ball?
> 
> Thanks in advance
> 
> Darren

First thing I would suggest, is test the return value from mail, that
you currently ignore, to see if the message was accepted by the MTA. If
that is true you know the script is fine and to pursue the problem
elsewhere. If false, check your MTA is setup properly.

--
Niel Archer


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux