Web Hosting Talk







View Full Version : php sends nobody as mail originator with sendmail


kevinm2
07-19-2005, 01:25 PM
I am using a shopping cart that is written in php. My E-mail transport is sendmail.

My problem is when the e-mail is sent out, it uses account 'nobody' from linux as the sender and not info@MyDomaincom. Tech poeple at the shopping cart forum, feel that this is a problem with php and sendmail not communicating properly or my system is setup wrong.

I would appreciate your help on this matter. Following are some some of the info that I thought might be helpfull.

I should add that all regular mail (not related to the shhopping cart or php) gets transffered properly.

Return-Path: <nobody@MyServer.MyDomain.com>
Received: (from nobody@localhost)
by MyServer.MyDomain.com (8.11.6/8.11.6) id j6J2dfgdS601594;
Mon, 18 Jul 2005 19:39:28 -0700
To: kevin@MyDomaincom
Subject: Message from My Store
Date: Mon, 18 Jul 2005 19:39:28 -0700
From: sdasdasd <kevin@MyDomain.com>
Reply-to: My Store <info@MyStore.com>
Message-ID: <4fc8be503689f63798db29ba2580da6b@wwwMyDomaincom>
X-Priority: 3
X-Mailer: PHPMailer [version 1.72]
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="iso-8859-1"
Status:


So when ISPs see a mail from nobody they immediatley reject it.

The original message was received at Mon, 18 Jul 2005 21:15:09 -0700
from nobody@localhost

----- The following addresses had permanent fatal errors -----
robert@CustomerDomaincom
(reason: 554 <nobody@MyServer.MyDomain.com>: Sender address rejected: Domain not found)

----- Transcript of session follows -----
... while talking to mail2.CustomerISP.com.:
>>> RCPT To:<robert@CustomerDomain.com>
<<< 554 <nobody@MyServer.MyDomain.com>: Sender address rejected: Domain not found
554 5.0.0 Service unavailable

Help.

deadserious
07-19-2005, 09:02 PM
From your example it looks like the mail was rejected for reasons other than the mail being sent from nobody. If you make sure that MyServer.MyDomain.Com in your example has all the correct DNS entires so that other mail servers can verify it exists, then your mail should go through.

You might want to check here to see if your mail server is set up so that other hosts can test it's existence: http://www.dnsreport.com/

You would probably want to check MyServer.MyDomain.Com from your example, of course you want to enter your real mail servers name.

NomadicKobra
07-19-2005, 09:11 PM
This came straight from PHP.net, so I hope it helps:


<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>