Click to See Complete Forum and Search --> : Mail with windows NT


Anon
07-13-2000, 01:05 PM
Hi!

What special configurations have to made if the mail() function is gonna work correct?
Now it just goes in a forever loop when i try to use the mail function.
A mail server is running on the NT server.

Don't now what to configure because i can't find anything about it in the php documentation.

In linux i just compiled it and it used the local sendmailserver.

//Mattias

Anon
07-13-2000, 01:19 PM
In the php3.ini file, add/edit the line

SMTP = <your smtp server>

where this is either the dns or ip address for the smtp server.

Anon
07-13-2000, 01:33 PM
Depending on what version of PHP you are using, some versions Pre Version 4 had a strange requirement that the mail function require a 4th blank argument if you aren't using it already.

Ex:

<?
mail("you@yourdomain.com", "Email", "Hello. Goodbye.", "");

?>

Brett

Anon
07-13-2000, 05:10 PM
I have the same problem w/ the infinite, inbox clogging, php mail() loop. An undocumented feature. None of the reply's here really even address the original question. Mattias, I don't have a resolution, but I have the same problem. Boy that helps :-) I miss .asp, and CF. I think php is truly meant for a Linux/Apache/MySQL configuration...

Anon
07-13-2000, 10:54 PM
Indeed ...

I have exactly the same problem and nothing from what suggested helped me :(

Any more tips to try?

firecool

Anon
07-15-2000, 01:01 PM
I was having the verry same problem, until I followed the previous instructions.

For me, it is the php.ini in my winnt directory. I too had smtp servous on my computer, but could not send messages. I used another SMTP server and made changes in php.ini, then I stopped the IIS ADMIN service and restarted all necessary services.

Now, my messages all go through.

lee graham wrote:
-------------------------------
In the php3.ini file, add/edit the line

SMTP = <your smtp server>

where this is either the dns or ip address for the smtp server.

Anon
07-17-2000, 01:49 PM
Perhaps we're talking about two different things here. I can get the mail function to work, but sometimes it gets stuck in a "loop"
and sends tons of emails to the same inbox. Literally thousands of emails... I thought that's what the original post was about... "stuck in a forever loop", but there's no loops in the code. I hope everyone knows how to write in the name of there mail server on the php.ini file
:-) HAve fun, as for me I'm still dying to switch to a Linux/Apache configuration, or go back to uaing .asp or CF...

Anon
07-18-2000, 10:01 AM
I doubt this is a problem with PHP's mail() function. I would be more inclined to check your control structure.

Since you didn't giva any details about what your code looks like, I'll make a few assumptions. Even with these assumptions, you should be able to use this technique to debug your application.

We'll assume you're using a for loop. If your app looks something like this now:
<pre>
for ($i = 0; $i < somefunc(); $i++)
{
mail($person, $subject, $message);
}

Then change it to this:

for ($i = 0; $i < somefunc(); $i++)
{
echo "This is iteration number '$i'. \n<br>";
}

I'll bet you find that you still have an infinite loop.

The reason I responded as such before is because I was having problems with the mail() function related to my SMTP server and the effects were the same as a loop. The page would never stop loading. Difference being that there were no emails being sent.

Hope this helps. If it doesn't, attach some code and people will be able to help more.

Matt Nuzum

Anon
07-18-2000, 02:17 PM
Thanks, but I forgot to specify one important detail: It's just the plain mail function. HThere is no other code. It is simply a form that submits and emails form data. no loops, no iterations, no database, nothing. That's the problem. It is the mail function and nothing else. When I first started I had the same problem w/ the page loading that you had Matthew, but that's a configuration issue I resolved. I don't know if we're all on the same page here, but my problem is that all of my php mail pages get set off at random times and just start sending off emails to wherever they are addressed to w/ blank data if the $to is hard-coded. It sends an email a minute (approximately) and the only way to stop it is reboot the server. It may have nothing to do w/ php. I mean at first the only thing I could thing of was a dos attack, or some 3rd party software setting it off. Either way it sucks...

Anon
07-19-2000, 12:04 PM
My promblem is now solved
Couldn't use my local mailserver at 192.168... hade to use my linux mailservers adress in php ini.

Anon
09-19-2000, 04:02 AM
THIS SOLVED MY PROBLEM, WHY IT ISN'T IN THE MANUAL, I DON'T KNOW

J