problem with php mail() function

hamed

Verified User
Joined
Jul 21, 2004
Messages
17
Location
Iran (Tehran)
Hello,
When I send emails using php mail() function, the sender will be like this:
username@hostname
for example: [email protected]

the script is fine, I tried it on my other DA servers and it's fine there, but one of the servers has this error!

Here it's the PHP code:
PHP:
<?
        $header="From: [email protected]\n";
        $msg="My test";
        $email="[email protected]";
        mail($email,"Activation email",$msg,$header);
?>

Anyone has any idea how it can be solved?

Thanks
 
Problem solved.
John kindly helped me to solve it.

PHP is running as suPhp/CGI , so scripts are running as users.
in /etc/exim.conf , there is a section called "trusted_users" which means exim will accept the From address for this users.
just added the username in that list and problem solved.
 
Back
Top