email - Test mail() function of PHP on localhost with Windows 8.1 -
how can test mail () function on local server?
use windows 8.
i tried using 'test mail server tool' (http://www.toolheap.com/test-mail-server-tool/) tool did not work, email not saved anywhere after execution of function .
on windows php needs additional configuration. smtp settings relevant. http://www.php.net/manual/en/mail.configuration.php
the emulator "test-mail-server-tool" listens on specified port, 25 , writes mail send there specific folder. takes place of real smtp server, in fact it's dummy testing purposes. if mail sent, should in specified folder of "tmst".
complete walk-through
- install "test-mail-server-tool"
- start tool
- go tray: set port 25 , folder email output
- create new php file source code send mail example below
- execute php file (in browser or on cli)
- go defined email output folder
- find "*.eml" file content of email
basic php example sending mail
<?php $from = "sender@sender.com"; $headers = "from:" . $from; echo mail ("receiver@receiver.com" ,"headline" , "text", $headers); ?>
Comments
Post a Comment