Site Fuse! programming, design, hosting, promotion and advertising tips for webmasters

Change return-path of script(PHP) generated email - mail from nobody

Home  \  Forums  \  Programming & Development Forums  \  PHP Forums  \  Change return-path of script(PHP) generated email - mail from nobody
Share   

user photo

MrPhear   1 years, 6 months ago

To have PHP scripts run as your username instead of nobody you must get your host to install php with suexec enabled. This means all your PHP scripts run under your account username rather than nobody.

The only problem that I have seen with running suexec is that it does affect alot of php scripts causing alot of 500 internal service errors pages. It can be very tricky sometimes to make get the php scripts to function with the suexec.

Instead;

mail("$to", "$subject", "$message", "From: $from\nX-Mailer: PHP/ . $phpversion()", "-f $from");


Notice the -f... that is the from address, by adding this at the end of the mail function you can bypass the nobody without using phpsuexec..

;)
user photo

fusionx   1 years, 6 months ago

My website sends email to people who register. The email contains a link that allows them to set their password. Your script is PERFECT. I haven't been able to get anything into an AOL inbox for awhile and there's no problem


Thanks!!!!
user photo

MrPhear   1 years, 6 months ago

Glad to hear that! :)
user photo
Guest