Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using mail() on Windows server

Status
Not open for further replies.

wuz

Programmer
Jul 10, 2000
18
0
0
US
A quick question here. Is there anything that I need to know when using the mail() function with a Windows server vs. a Unix server?

I'm using the following code at its most basic form:
mail("$email", "Test", "Test");

and it doesn't work on the Windows server, though it does work on my Unix one. (Tried it with the actual email address, too.) I figured maybe I'm missing something basic. The other PHP codes work fine on the Windows server, so I'm really stumped here.

Any ideas?

Thanks,
Susan :)
 
In the php.ini file, you have the set up which is the SMTP server so that PHP knows where to mail the stuff to.

Look for a line in the config that looks something like:

[tt]
[mail function]
[/tt]

And then right below it it should say something like:

[tt]
SMTP = localhost ;for win32 only
[/tt]

Where you change localhost to be your SMTP server.

Hope this helps.

-Vic vic cherubini
krs-one@cnunited.com
 
Thanks, Vic!

I do appreciate the info. I talked to the host, and he said the SMTP is set up on the ini file (even gave me the SMTP name), so I'm not sure why I'm getting the error. The error message is:

Warning: Server Error in f:\ on line 9

and the code on test.php is:

<html>
<head>
<title>Test Email</title>
</head>
<body>
<?php
mail(&quot;info@site.com&quot;, &quot;Test&quot;, &quot;Test&quot;);
?>
</body>
</html>

Any other ideas? I am really stumped.

Thanks!
Susan :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top