View Single Post
Old 2nd June 2009, 08:22 AM   #1 (permalink)
matt_b
Registered User
 
Join Date: Jun 2009
Posts: 8
php mail() works, but only when I send to other domains

I've just signed up and moved my hosting to UH, and everything is working well so far.

However, on my site I have a contact form that has stopped working - upon submission I get the following error:

Code:
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, info@mydomain.co.uk and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
If I change the email address from info@mydomain.co.uk to my personal gmail address, it works fine.

The PHP code behind my contact form is below:

Code:
$name = $_REQUEST['name'];
$company = $_REQUEST['company'];
$email = $_REQUEST['email'];
$phone = $_REQUEST['phone'];
$msg = $_REQUEST['msg'];

$todayis = date("l, F j, Y, g:i a") ;
$subject = "Web Lead";
$message = "Call: $name\nCompany: $company/nPhone: $phone\nEmail: $email\nMessage: $msg\n";

$headers = "From: Web Lead <weblead@mydomain.co.uk>\r\nX-Mailer: php";

mail("info@mydomain.co.uk", $subject, $message, $headers);
My nameservers have been changed to UH, MX records created etc. and all other email to @mydomain.co.uk works fine.

Does anyone have an idea what I need to change?

Thanks
Matt
matt_b is offline   Reply With Quote