Click to See Complete Forum and Search --> : php and sendmail


Anon
03-28-2001, 11:32 PM
Hi all...

I am running a php test server; however, I am learning about php on the fly.

I am having a problem with my users trying to send emails with php.

I can run the following script successfully as root, but not as a normal user:

<?php
//first_mail.php
$mail_to ="an_addr@xyz.com";
$mail_subject = "An email subject";
$mail_body = "This message was generated with a php script\n";
if(mail($mail_to, $mail_subject, $mail_body))
echo "Successfully sent the e-mail \"$mail_subject\" to $mail_to.";
else echo "Failed to send the e-mail \"$mail_subject\"."
?>

I don't understand what to do in response to the following error that I get on an unsuccessful attempt:

Can't create transcript file ./xff2T3KMx03834: Permission denied
X-Powered-By: PHP/4.0.4pl1
Content-type: text/html
Failed to send the e-mail.

What's a guy to do?

Any advice would be greatly appreciated.

RNV

Anon
03-28-2001, 11:33 PM
c

mwilson
03-29-2001, 03:20 AM
Why not use the php mail routine? this goes via sendmail anyway IIRC. As for your error, it looks like its because a normal user doesn't have write permissions to the current directory to create a temporary file for mailing (hence the ./).

asciipixel
08-07-2002, 10:16 AM
How do I change the user / Permission so that the right user accesses the proggie ?