Re: Emailing a Database

From: Date: Tue, 10 Oct 2000 05:35:03 +0000
Subject: Re: Emailing a Database
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-3453@lists.php.net to get a copy of this message
At 09:25 PM 9/10/2000, you wrote:
PHP could perform this function, assuming you want to use a web page to generate the E-mail each time. Did you look at mail functions? <http://www.php.net/manual/ref.mail.php> Do something like ... (pseudo-code): SELECT EMail from MailingList; foreach (of the results)
    mail ($Result["EMail"], $Subject, $Message);
This is something ive come across with different server installs since ive been playing with PHP. In my original installation of PHP, I was able to use the mail() function (it was a stock standard isntall of FreeBSD 4.0 running PHP4.0b4) and mail() worked like a charm. But moving the databases I was working on to the intended boxen, instantly the mail() stopped working (FreeBSD 3.4 box running the same PHP version). I had to use a function which physically calls sendmail and does it that way. function sendmail($to, $from, $body) {
        $proc=popen("sendmail -bm -f$from $to","w");
        fputs($proc,$body);
        pclose($proc);
} Using this I was able to make sendmail do my mailing for me, but it was strange why mail() stopped working. Does anyone have an idea why this occured or what would make it stop? Thanks Chris

« previous php.db (#3453) next »