|mail function problems|
tech support says it is my fault
| 8:30 pm on Sep 27, 2002 (gmt 0)|
alright this is driving me nuts and I have been trying to find the answer.
My trusty mail script that has been around the block many times and nestled into many servers with no probs is freaking out.
We get this Server Error in D:\script.php on line 113
no problem, 113 is
mail ($toemail, $subject, $inputMessage, $from);
I think the from is what it is choking on
$from = "From: " . $fromemail . "\nContent-type: text/html\n";
The only thing I can think of is that
sendmail_from = firstname.lastname@example.org.
sendmail_path = no value
SMTP = mail.something.com
the support guy hacked up my script and it worked, the only difference was
$from = $email //email value from form
tried that and it still didn't work, any ideas?
| 8:54 pm on Sep 27, 2002 (gmt 0)|
alright, I have more info in this conversation with myself.
from php.net on mail function
The Windows implementation of mail() differs in many ways from the Unix implementation. First, it doesn't use a local binary for composing messages but only operates on direct sockets which means a MTA is needed listening on a network socket (which can either on the localhost or a remote machine). Second, the custom headers like From:, Cc:, Bcc: and Date: are not interpreted by the MTA in the first place, but are parsed by PHP. PHP < 4.3 only supported the Cc: header element (and was case-sensitive). PHP >= 4.3 supports all the mentioned header elements and is no longer case-sensitive.
so got that licked but it seems to be the message that is bombing it out. So, I have a setup like so
$inputMessage = "first line of html";
$inputMessage .= "second line of html";
if I have just text in it everything works but doesn't seem to.
anyone know of some settings or vars that I should look at?
| 9:19 pm on Sep 27, 2002 (gmt 0)|
I've sometimes had problems with this if you don't specify a Reply-To: header in the $extra bit....
Never had errors, but on at least one system (linux or freebsd) it would not send the mail...
BTW, talking to yourself is the first sign of madness.
Who said that?
Oh, that's okay then...
| 9:27 pm on Sep 27, 2002 (gmt 0)|
The whole problem
windows, windows, windows junk servers messing up php
It wouldn't allow me to specify the extra bits, only recognizes Cc: in the extra stuff. Had to swap out all of my html and just write it plain with \r\n to get my newlines.
OT anyone notice that in the blurb above it talks about php version less than 4.3 but the last released version is 4.2.3
Maybe a new release soon?
| 7:49 pm on Sep 28, 2002 (gmt 0)|
Have you tried replacing the $from with something hard coded like "From: email@example.com";?
| 8:00 pm on Sep 28, 2002 (gmt 0)|
php on windows just doesn't allow extras in the mail function. They just get crammed into the top part of the message. I just removed the extras all together and left it as is.
| 4:14 pm on Sep 29, 2002 (gmt 0)|
Understood and I'm not surprized. It seems that everytime I hear of someone using IIS (or whatever it's called now) and PHP together it's always accompanied with a story or two about how they had to kluge something to make PHP work like it should.
Best of luck with it.