...

View Full Version : PHP contact form problem



thresher
09-16-2009, 09:35 AM
I am trying to make a PHP contact form on a website, that takes info entered into a contact form and sends it to a client's email.

The problem I am having is that the domain name and domain emails are hosted on a seperate server to the site files and CMS databases.
When the form tries to send to the email address, the enquiry fails (due to the fact that the email is in fact on a seperate server to the contact form, I believe).

Is there anyway to avoid this problem?

The code I am using to process the contact form is as follows:



$send = "email@domain.com";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html; charset=utf-8" . "\r\n";
$headers .= "From: $name <'$email'>" . "\r\n";
$subject = "Booking enquiry from domain.com - $name";
mail($send,$subject,$body,$headers);

header("Location: booking_thankyou.php");


Obviously with 'email@domain.com" being the domain email address.

The error code I get is:

Warning: mail() [function.mail]: SMTP server response: 550 Requested action not taken: mailbox unavailable or not local in...

angst
09-16-2009, 04:02 PM
you need to change the local host name on the box to something other then the main domain name for the site.

so your mail server is likely something like: mail.domain.com
as such your web server should be: web.domain.com

that should solve your problem.

thresher
09-16-2009, 04:20 PM
you need to change the local host name on the box to something other then the main domain name for the site.


Hi, thanks for the reply, but I'm not sure I understand what you mean. Where do you mean by 'on the box'?

angst
09-16-2009, 04:22 PM
box as in server, if you or your company runs this server then you need to change the host name.

thresher
09-16-2009, 04:25 PM
box as in server, if you or your company runs this server then you need to change the host name.

AH! Sorry, I understand now. Thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum