[thelist] PHP mail

Joe Crawford artlung at artlung.com
Tue Dec 12 22:00:22 CST 2000


On Wed, 13 Dec 2000, Adrian Fischer wrote:
> I am using php to send some mail and it tells me Im sending ir From: nobody.
> I woudl like to be able to say its From: Yournamehere.  This is what the bit
> of script looks like that sends the email:
> mail ($email, "E*REMINDERS PASSWORD", $message);
> 
> I have been through the entire script to find the function mail() but cant
> so am assuming (accepting what that may imply) that mail() is inbuilt into
> php and I cant change it??
> 
> So..the question is:Can I add a From addressee?

You can indeed - I have using an additional header - you can have a 4th
paramater to the mail() function which adds additional headers (like those
wacky x-evolt headers). You can also add "From".

Here's a grab from some of my own code:

<?php
// SENDING A BUNCH OF MAIL
//--------------------------------------------------
mail("$to_name <$to_email>",
     "$subject (a message from $from_name)",
      $message_to_person,
     "From: $from_name <$from_email>");
?>

Read more about the exotic world of mail() at:     
http://www.php.net/manual/function.mail.php

	- Joe
--
Joe Crawford <mailto:joe at artlung.com>
 * I am a Web Designer and Developer;
 * Find out about me at : http://www.ArtLung.com
 * A Mailing List for San Diego Web Folks : http://WebSanDiego.org





More information about the thelist mailing list