… a question that raises in the mind of programmers developing applications in their local development environments.
This can be achieved by making the following modifications.
Step (i) Install the WAMP / XAMPP server in your windows machine. After this install you will be able to access sites created on the localhost with URL http://localhost
Step (ii) Download and extract the send mail application for Windows from http://glob.com.au/sendmail/. Remember the path where you have extracted sendmail. For e.g. c:\wamp\sendmail
Step (iii) Edit sendmail.ini within c:\wamp\sendmail. This ini file has enough documentation explaining how the configuration changes should happen on the file.
Check through the following list of parameters to make sure correct values are set
smtp_server=mail.sampledomain.com
smtp_port = 25 (check the mail server’s port number to make sure that you set the correct port)
auth_username=username@sampledomain.com
auth_password=userpassword
Step (iv) Edit PHP.ini file
Next step is to change the php.ini native to the installation . Search for the string “sendmail_path”
Set this path to the folder where send mail installed
sendmail_path = “c:\sendmail\sendmail.exe -t -i”
Step (v) PHP Email program to send email
To send email using Google Mail server, there is slight variation in step (iii)
Step (iii) Edit sendmail.ini within c:\wamp\sendmail. This ini file has enough documentation explaining how the configuration changes should happen on the file.
Check through the following list of parameters to make sure correct values are set
smtp_server=smtp.gmail.com
smtp_port=465
smtp_ssl=ssl
default_domain=localhost
error_logfile=error.log
debug_logfile=debug.log
auth_username=myname@gmail.com
auth_password=my_gmail_password
pop3_server=
pop3_username=
pop3_password=
force_sender=
force_recipient=
hostname=localhost
Note: Log into myname@gmail.com email account and check in Account Settings under "Forwarding and POP/IMAP" for IMAP access and "Enable IMAP" access.
In the WAMP Server, we need to enable
a) Apache module - ssl_module
b) PHP extensions - php_openssl, php_sockets
Restart WAMP server and execute the php program to send out emails.