0

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

SMTP mail.isp.com

On the website we have a contact form which emails [email protected] after the user submits it.

Using the default setting:

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

And custom settings:

 sendmail_from [email protected]

I was able to successfully send the mail to external domains other than @sample.com. 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?

2 Answers 2

1

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.

<?php
include("Mail.php");
/* mail setup recipients, subject etc */
$recipients = "[email protected]";
$headers["From"] = "[email protected]";
$headers["To"] = "[email protected]";
$headers["Subject"] = "User feedback";
$mailmsg = "Hello, This is a test.";
/* SMTP server name, port, user/passwd */
$smtpinfo["host"] = "smtp.mycorp.com";
$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.

0

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 smtp.sample.net and send mail from there.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .