Mail Function

From: Date: Tue, 27 Aug 2002 18:32:51 +0000
Subject: Mail Function
Groups: php.db 
Request: Send a blank email to php-db+get-21401@lists.php.net to get a copy of this message
hi, I know this question is in the wrong group, but I hope someone maybe able to help me out. I need to use the mail() function in my code to send out mails which I am able to do successfully. But I am not able to set the 'from address' in the mail I sent. It always varies. Can I set the from address field as to my liking. I tried the following code <?
        $toaddress = "manojjapher@rediffmail.com";
        $fromaddress = "manojjapher@hotmail.com";
        $subject = "Test Mail";
        $content = "Your username and password as you requested \n"
                   ."Username = user \n"
                   ."Password = pass \n";
        mail($toaddress, $subject ,$content, $fromaddress);
        echo " Your username and password has been mailed to you ";
    ?>
And the mail I got had the from address as apache@localhost.localdomain. Can someone help me out please Best Regards, Manoj 'I have miles to go before I sleep, and promises to keep'

« previous php.db (#21401) next »