You are here: Re: test mail() on development machine w/o smtp server « PHP Programming Language « IT news, forums, messages
Re: test mail() on development machine w/o smtp server

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация