|
Posted by Rik on 06/17/07 16:28
On Sun, 17 Jun 2007 17:05:43 +0200, William Gill <noreply@gcgroup.net>
wrote:
> My development machine (WinXP, Apache 2.2.4) does not have an smtp
> server, and I don't really want to install one if I can help it.
Don't need to, just use any SMTP server you like, it's not like working
with sockets on UNIX. Local, ISP, doesn't matter.
> Does anyone know of a simple method of testing php scripts that employ
> mail() by simulating an smtp server and directing output to a text file
> or to an installed text editor.
>
> Right now I can modify the script to use something instead of mail(),
> then change it when I put into production, but I would really like to
> test the script in its production form w/o having to actually send email.
>
Why go to the trouble of simulating an SMTP server? Define a function
my_mail(), let it log to a file while testing, let it call mail() on
production, and you're set. Just one little change ( or pehaps even make
the function behaviour dependend on some enivronmental variables so it
automatically chooses the right action.
--
Rik Wasmus
Navigation:
[Reply to this message]
|