Re: [Nolug] Redhat 9 server eating ram like candy...

From: Jeff <jeffreydavidlee_at_hotmail.com>
Date: Sat, 27 Mar 2004 13:48:10 -0600
Message-ID: <BAY13-DAV37HQnCcdAP0001c1d3@hotmail.com>

Can someone help me with a php mail function? I believe it is setup
correctly but some part of my OS or setup is not telling it do its job.
Below are two scripts, the first doesnt work on my system and the second
does. Hope I can get it to work with your help

THIS DOESNT WORK
function sendMail($email, $subject, $message) {

  if ($email == '' or $email == NULL) {
   $this->_systemRespons[$this->_systemReOwner]['info'] =
'phpUserLogin_EMAIL_NONE';
   return FALSE;
  } else {
   if (mail($email, $subject,
$message."\n\n".$this->_systemText['email_footer'], 'From:
'.$this->_systemOptions['email_reply']."\r\n".'Reply-To:
'.$this->_systemOptions['email_reply']."\r\n")) {
    return TRUE;
   } else {
    $this->_systemRespons[$this->_systemReOwner]['info'] =
'phpUserLogin_EMAIL_NO_GO';
    return FALSE;
   }
  }
 }

THIS WORKS
$body = "Some message";
$sender = "someemail";
$sendmail = "/usr/sbin/sendmail -t -f $sender";
//Send mail to user
$fd = popen($sendmail, "w");
fputs($fd, "To: $email\r\n");
fputs($fd, "From: \"Someuser\" <$sender>\r\n");
fputs($fd, "Subject: some subject\r\n");
fputs($fd, "X-Mailer: Mailer Name\r\n\r\n");
fputs($fd, $body);
pclose($fd);
___________________
Nolug mailing list
nolug@nolug.org
Received on 03/27/04

This archive was generated by hypermail 2.2.0 : 12/19/08 EST