How To Test Rails ActiveMailer Emails In Your Development Environment
Posted by Weston Ganger
You definitely need to test your emails that you send in your app. Skipping them in development is not a good idea.
There are two methods for you to do this:
My personal favourite is the simple fake SMTP server with Python which just pipes the email through your log which is what I usually want.
# Create Init.d Startup Script to Start Fake SMTP Server on System Startup sudo echo "python -m smtpd -n -c DebuggingServer localhost:25 > /dev/null 2>&1 &" > /etc/init.d/fake-smtp # replace /dev/null with a file if you want to keep your email logs. sudo chmod +x /etc/init.d/fake-smtp sudo update-rc.d fake-smtp defaults # Start Script Right Away without Rebooting sudo /etc/init.d/fake-smtp start
Related External Links: