PDA

View Full Version : ISPConfig, PHP mail() problem


tbakerisageek
17th July 2006, 22:49
Hey folks,
I am runninng Ubuntu 5.10, ISPConfig perfect setup as followed at http://www.howtoforge.com/perfect_setup_ubuntu_5.10. My issue is when I run a php script containing "mail(tbaker@tbakerisageek.com, "mail from contact form", $body, $headers),

My $headers ='"From: '.$txtEmailAddress.'"'(Single,Double,Single Quotes) = "From: foo@example.com" In my headers sent to the email address I see my From: foo@example.com but before that is added as headers, "From: www-data@tbakerisageek.com (www-data)
" is run as a header first. Resulting in all my email being sent from script coming from www-data. I plan to use this for more than just emailing myself. How do I disable this functionaliy, and make it so I can specify with my $headers, what address it "comes from"??

Thanks for the help in advance.

tbakerisageek
17th July 2006, 23:50
After more testing, tweaking, and general playing around... I figured it out.

looking through the headers lead me to the problem. The original headers "www-data" were not quoted. I modified my code to not quote my $headers string and it came through correctly. It looks like if you specify new headers for any message, the LAST Specified headers are read and used by mail clients (outlook 2003 in my case)