Welcome to WebmasterWorld Guest from 107.20.5.156

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

mail function problems

tech support says it is my fault

     

jatar_k

8:30 pm on Sep 27, 2002 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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 = addressnobody@whatever.something.com.

other stuff
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?

jatar_k

8:54 pm on Sep 27, 2002 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



alright, I have more info in this conversation with myself.

Windows server

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?

Nick_W

9:19 pm on Sep 27, 2002 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Hey Jatar,

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...

Try it.

BTW, talking to yourself is the first sign of madness.

Who said that?

What?

Oh, that's okay then...

Nick

jatar_k

9:27 pm on Sep 27, 2002 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Thanks Nick,

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?

lorax

7:49 pm on Sep 28, 2002 (gmt 0)

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Have you tried replacing the $from with something hard coded like "From: test@domain.com";?

GB

jatar_k

8:00 pm on Sep 28, 2002 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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.

lorax

4:14 pm on Sep 29, 2002 (gmt 0)

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Jatar_K,
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.

GB