Mail() under IIS

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ofernand
Forum Newbie
Posts: 2
Joined: Mon Feb 10, 2003 10:59 am

Mail() under IIS

Post by ofernand »

I would like send a email via the function mail() under windows 2000 with IIS5. Is it necessary to have a server of mail. And how configure php to use it? Where i can find some documentation about this function.
:?
cctrax
Forum Commoner
Posts: 36
Joined: Thu Jul 11, 2002 9:05 pm
Location: United States
Contact:

Post by cctrax »

As for the documentation...your best bet may be the configuration section of the PHP Manual (http://www.php.net). And yes - you are going to need some type of mail server built into your system in order to use this bad boy.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You may also be able to setup PHP to use the SMTP server of your ISP.

Mac
ofernand
Forum Newbie
Posts: 2
Joined: Mon Feb 10, 2003 10:59 am

Post by ofernand »

Is it possible to use php with microsoft exchange for smtp and pop protocole (intranet). And if not wich mail server i can use (under windows).
olivier :?:
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

If you have the address of your SMTP server you just need to edit your php.ini to reflect it and then try the mail() function to see if it will work.

More info:
http://www.php.net/manual/en/function.mail.php
http://www.php.net/manual/en/configurat ... ation.file

You need to configure this part of the php.ini:

Code: Select all

їmail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = me@localhost.com
replacing SMTP and sendmail_from with the correct values.

Mac
bowhuntr
Forum Newbie
Posts: 6
Joined: Thu Feb 13, 2003 8:05 am

Post by bowhuntr »

IIS can be installed with it's own SMTP server also. To find out if yours does if you are not sure just telnet to IP address of IIS server on port 25

example telnet 192.168.1.1 25

220 IISserver.mydomain.com Microsoft ESMTP MAIL Service, Version: 5.0.2195.2966 ready at Thu, 13 Feb 2003 17:12:58 -0500

If you get a response similar to that then you should be able to set that server up in your php.ini file as the smtp server.
Post Reply