[wplug] PHP, MySQL, sendmail?

John Harrold jmh17 at pitt.edu
Thu Jun 19 11:26:02 EDT 2003


Sometime in June Scott Bourns assaulted the keyboard and produced:

| Okay, I need to do one thing with sendmail on my web server, but I can't
| figure it out.
| 
| I want to use the PHP mail() function to send e-mail when entries are made
| to certain databases from php-imbedded html pages. Nothing that crazy, but
| I'm new to linux system admin., and can't find a resource that answers two
| questions:

i think i've done this in the past. i believe i just tried sending mail
from a simple php script and looked at the error. what to do next was based
on the error (if i got one). 

i just tried the following on our webserver:

<mymail.php>

<?php


srand((double)microtime()*1000000);

$hash  = md5(rand(0,9999999).time());

print "some random number ".$hash;

mail("jmh17 at pitt.edu", "subject" , " some random number $hash",
  "From: jmh17 at pitt.edu\r\n"."Reply-To: jmh17 at pitt.edu\r\n");
?>

</mymail.php>

and it worked fine. i don't recall if we changed anything on sendmail from
the default redhat 9 setup.

| 1. Do I need to configure client, server, or both for sendmail.
| 
| 2. Where can I get a sample config to just send from local sources (php
| calls) to an external mail server?
| 
| FYI I've gotten as far as how to alter configs, (via m4 module - sendmail.mc
| etc.) but don't know what exactly I'm supposed to be altering.

try a simple script and look at any errors you get. keep in mind that they
might be emailed to root if they are sendmail failures. 

-- 
--------------------------------------------------------------------------
                                               | /"\
 john harrold                                  | \ / ASCII ribbon campaign
      jmh at member.fsf.org                    |  X  against HTML mail
           the most useful idiot               | / \
--------------------------------------------------------------------------
 What difference does it make to the dead, the orphans, and the homeless,
 whether the mad destruction is brought under the name of totalitarianism or
 the holy name of liberty and democracy?
 --Gandhi
--------------------------------------------------------------------------
gpg --keyserver keys.indymedia.org --recv-key F65A739E
--------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://penguin.wplug.org/pipermail/wplug/attachments/20030619/4b51e7b9/attachment-0001.bin


More information about the wplug mailing list