Send email SMTP from localhost with WAMP setup

Ryan picture Ryan · Jan 27, 2011 · Viewed 7.4k times · Source

I'm trying to configure my php.ini file so I can send emails from 'localhost' in my dev environment using PHP. I no longer have access to an open SMTP server, and Gmail no longer works with their new SSL setup. I've done a lot of research and seen lots of "solutions" here and elsewhere, but they don't work. I've tried installing local SMTP servers (hMailServer asks for a password to install, Free SMTP Server doesn't work, etc).

Does anyone know of a free SMTP server I can setup in my php.ini file, or any other way to send mail from localhost (I just need it for testing purposes). I don't want to have to change code and send emails in a completely different way when I switch to production. (I'm using Zend and the Zend_Mail class)

Answer

Kevin Schroeder picture Kevin Schroeder · Jan 27, 2011

You could try using Zend_Mail_Transport_File for testing instead.

$mail = new Zend_Mail();
$mail->send(new Zend_Mail_Transport_File());