If you are developing a portal, you will definitely need the engine to send out emails, but in Windows, if you have Apache, PHP and MySQL installed, the mail() function of PHP will not work without additional configuration. Read on, and you’ll realize that today this isn’t a challenging task, and you can even develop your application without Internet access.
First make sure that your workstation is set up properly, and you know where your php.ini is. In this tutorial I used the VC6 x86 thread-safe version of PHP5.3 and Apache2.2.14 win32 x86. If you have a 64bit system, or other releases, paths may differ, but the modifications should be the same.
You’ll need to install a mail server on you computer, so go and download Axigen Mail Server for Windows and follow the on-screen instructions. It is compatible with all versions of Windows.
1.1 In the configuration wizard enter a domain name for development, something like your computer’s name. Mine is chasm. The postmaster account will be the email account we’ll be using to receive the emails from your application.

1.1 Axigen Configuration Wizard
1.2 In the Alias configuration screen, tick both checkboxes.

1.2 Axigen Configuration Wizard
1.3 Enable the Webmail service, and assign it to port 6667. You do not want the webmail to be conflicting with Apache.

1.3 Axigen Configuration Wizard
1.4 If you do not want others to use your email server, check only 127.0.0.1, otherwise enable the corresponding interfaces.

1.4 Axigen Configuration Wizard
1.5 Now, your configuration is almost done. Go to http://127.0.0.1:9000 and use the username admin and the password you gave the installer (it might not be the same password than the postmaster password!)

1.5 Axigen Configuration Wizard
1.6 The next step is in the webadmin, go to Domain and Accounts->Manage Accounts, click on your domain name, and click on the edit button for the postmaster account.

1.6 Axigen WebAdmin
1.7 Here, add a few aliases to your postmaster account. Any aliases you create, for example testmail1 becomes testmail1@yourdomain, but still all the emails will go to the postmaster account, you will soon see why this is so convenient!

1.7 Axigen WebAdmin
We will have to set up a few things for php to be able to send emails. Go to you php.ini, usually located at:
C:\php\php.ini
C:\Program Files\PHP\php.ini
You will have to find the lines:
[mail function] ; For Win32 only. ; http://php.net/smtp SMTP = localhost ; http://php.net/smtp-port smtp_port = 25 ; For Win32 only. ; http://php.net/sendmail-from ;sendmail_from = me@example.com
And change the sendmail_from parameter to postmaster@yourdomain.
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = postmaster@chasm
You can also make this change in PHP, with the ini_set function.
<?php ini_set( 'sendmail_from', 'postmaster@chasm' ); ?>
1.8 Let’s look at the WebMail we enabled earlier. Open http://127.0.0.1:6667/ to view it. Sign in with the username postmaster and the password you specified in the wizard. You will see a beautiful WebMail interface. Leave it open, as we’ll need it to read the incoming emails.

1.8 Axigen WebMail
If you have your own application ready, you can test its email functionality right away, or you can use this minimal php script, which sends an email with the subject my email subject and the message body hello email world! to testmail1@chasm. Any email you send to the aliases created in step 1.7 will have their messages inside the postmaster account, so you can test sending different emails to different users in your system, but still check the content of them in one place.
<?php if ( mail( 'testmail1@chasm', 'my email subject', 'hello email world!' ) ) { echo 'email sent!'; } ?>
If you run this script and the output is email sent! then you have successfully set up your workstation, to send and receive emails, without the need to be connected to the internet or using your far-away online server.
By the way, I am in no way affiliated with Axigen, or any company related to Axigen, I just found their mail server and liked it.

