Forum Moderators: coopster

Message Too Old, No Replies

PHP4: Configuring one's system to use the mail() function

Can anyone tell me how to configure my system so that I can use mail()

         

jd80

2:40 am on Feb 25, 2004 (gmt 0)

10+ Year Member



I need to be pointed to a good tutorial or directions on how to configure your computer to use PHP's mail() function. My operating system is Windows XP home edition. I'm running Apache 2.0. What steps do I need to take? Many thanks!

John

coopster

9:17 pm on Feb 25, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Have you set your mail [php.net] configuration directives?

Timotheos

12:28 am on Feb 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think we're assuming that you've set up a mail server on your Windows XP machine.

coopster

1:56 pm on Feb 26, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Good point, Timotheos.

PHP has a mail function but it requires a mail program. When running on Windows, PHP uses the SMTP server you specify in your

php.ini
file. Find the SMTP directive in your php.ini and it probably says localhost. If you are running an SMTP server on your machine, then localhost should work. If you are not running an SMTP server on your machine, you have two choices that I am aware of. If anyone has other options, please join in!

You can use another mail server, depending on how your computer is connecting to the Internet. I get an IP address and DNS servers from my ISP. Therefore, when I put

mail.myisp.net
in the SMTP directive, PHP will use that mail server when executing mail functions.

Windows does have an SMTP server, but it is not installed by default. You have to go to your Control Panel -- Add or Remove Programs -- Add/Remove Windows Components -- Internet Information Services and click the Details... button. In there you are going to find the SMTP Service. Like any other service, once it is installed you can configure it to start automatically, manually, etc.

I don't know of any tutorials, never searched for one...but maybe this will help you make sense of the issue.

jd80

9:59 pm on Feb 26, 2004 (gmt 0)

10+ Year Member



Thanks for the leads guys.

John

mipapage

10:52 pm on Feb 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jd80 - be sure and tell us if you get it working - I could never get it going when trying to use my local ISP... I seem to recall that in php.ini there was nowhere to specify the password that I use to log in to mail.myisp.com. I may be way off base...