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

  1. install "test-mail-server-tool"
  2. start tool
  3. go tray: set port 25 , folder email output
  4. create new php file source code send mail example below
  5. execute php file (in browser or on cli)
  6. go defined email output folder
  7. 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

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -