Sending email from a Rails application requires you to configure ActionMailer to use a SMTP mail server that is willing to handle your messages.
Using Google's Gmail is a good way to do this - reliable, free and likely to be around for a while. But going that route you need a slightly non-standard configuration and another gem as ActionMailer does not support the SSL/TLS (Transport Layer Security) that Gmail uses.
Various ways to do this show up in a web search but some of these seem a little outdated (Please add publication dates to your technical web posts!).
As of June 2009 with Rails 2.2.2, this post from Sam Pierson works for me.
1: sudo gem install tlsmail
2: Add the block he shows to the end of your environment.rb file (after the end of the Rails::Initializer.run block)
I use Gmail as part of Google Apps and in this case you want your gmail username to be your Google Apps email address (e.g. myname@mydomain.com and not just myname).
A collection of computer systems and programming tips that you may find useful.
Brought to you by Craic Computing LLC, a bioinformatics consulting company.
Tuesday, June 2, 2009
Subscribe to:
Post Comments (Atom)
Contributors
Archive of Tips
-
▼
2009
(53)
-
▼
June
(9)
- Sending Email from a Linux machine
- Erasing Disks on Linux Machines
- Removing a Linux machine from LDAP
- Finding the Address of your DHCP Server
- Migrating a MySQL 3.23 database to 5.0
- Simple Example of using the YUI Tooltip Widget for...
- Combing PDF pages using Preview in Mac OS X
- Resizing Browser windows to a Fixed Size
- Sending Email from Rails via Gmail
-
▼
June
(9)
No comments:
Post a Comment