Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We use a hosting company for our website but we have our mail servers hosted by our isp with our website domain;


On the website we have a contact form which emails after the user submits it.

Using the default setting:

SMTP localhost
sendmail_path /usr/sbin/sendmail -t -i

And custom settings:


I was able to successfully send the mail to external domains other than After looking into this I believe it is because the SMTP is localhost and not properly pointed at our ISP mail servers.

What value would I put in the SMTP if I have an external company hosting the site with our mail servers being hosted by our ISP?

share|improve this question

Apart from what @adamo said which is indeed probable, you could also try sending out mail using PEAR::Mail.

Here's some sample code from unixcraft you can try out.

/* mail setup recipients, subject etc */
$recipients = "";
$headers["From"] = "";
$headers["To"] = "";
$headers["Subject"] = "User feedback";
$mailmsg = "Hello, This is a test.";
/* SMTP server name, port, user/passwd */
$smtpinfo["host"] = "";
$smtpinfo["port"] = "25";
$smtpinfo["auth"] = true;
$smtpinfo["username"] = "smtpusername";
$smtpinfo["password"] = "smtpPassword";
/* Create the mail object using the Mail::factory method */
$mail_object =& Mail::factory("smtp", $smtpinfo);
/* Ok send mail */
$mail_object->send($recipients, $headers, $mailmsg);

Another solution (in case you want ALL mail going through the remote mail server) is to configure SSMTP as your sendmail binary.

share|improve this answer

The problem is that your domain's MX servers (at your ISP) do not accept email sent from elsewhere (outside the ISP) that claims to be from you as legitimate. You have to contact your ISP's mail technical support (this is not a first level support request of the "my outlook is not working" style) and solve this.

I've blogged about a similar case here.

In your case the simple solution might be the ISP allowing your webhost to connect to and send mail from there.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.