O'Reilly logo

Learning Rails: Live Edition by Edd Dumbill, Simon St. Laurent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Test Your Knowledge

Quiz

  1. Where do you tell Rails how to send email?

  2. How do you specify which variables fit where in a given mail message?

  3. What additional field needs to be specified in the model to send HTML email?

  4. Can Rails check a POP-3 inbox for messages?

Answers

  1. The configuration files in config/environments/development.rb, testing.rb, and production.rb—are a good place to specify the settings that Rails should use to send outgoing mail.

  2. A model class extending ActionMailer::Base containing a method that sets email parameters can handle all of the header information for email messages, and a view can define their content.

  3. To send HTML email, the content_type must be set to text/html for simple HTML email, or to multipart/alternative for messages containing images, stylesheets, or other contents beyond the HTML.

  4. Yes, Rails can check a mailbox to see whether anything has come in, and retrieve and process messages.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required