[thelist] All emails from php are from nobody

Lauri Väin optima at hot.ee
Sun Oct 22 16:37:37 CDT 2000

> I recently moved from a BSD server to a Linux server and now all my emails 
> that are php generated are sent from "nobody".  

"Nobody" is the username Apache and Sendmail processes are usually run. 

> Can anyone offer a suggestion as to how to fix this?  
> The php mail code hasn't changed and worked find before.

You should specify the "From" if you haven't already done so! 
Below is a snip from the registration code of a service I'm currently coding. 

  $admin_email = "admin at infoedit.ee";
  $subject = "Teie InfoEditi CV kasutajainfo";
  $contents = "\n Hello $firstname,\n";
  $contents .= "Thanks for registering\n";
  $contents .= "blah blah blah\n
  $contents .= "\nYour userinfo: \n";
  $contents .= "E-mail:     $email\n";
  $contents .= "Password:   $sala\n\n\n";
  $contents .= "Thanks!, \n";
  $contents .= "-InfoEditi Team\n\n";

  $date = date("D, j M Y H:i:s +0200");

  $headers = "From: InfoEdit team <$admin_email>\n";
  $headers .= "$date\n";
  $headers .= "MIME-Version: 1.0\n";
  $headers .= "Content-Type: text/plain; charset=\"iso-8859-4\"\n";
  $headers .= "Content-Transfer-Encoding: 8bit\n";

     mail($user_email, $subject, $contents, $headers);


More information about the thelist mailing list