Test Your Knowledge
Quiz
Where do you tell Rails how to send email?
How do you specify which variables fit where in a given mail message?
What additional field needs to be specified in the model to send HTML email?
Can Rails check a POP-3 inbox for messages?
Answers
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.
A model class extending
ActionMailer::Basecontaining a method that sets email parameters can handle all of the header information for email messages, and a view can define their content.To send HTML email, the
content_typemust be set totext/htmlfor simple HTML email, or tomultipart/alternativefor messages containing images, stylesheets, or other contents beyond the HTML.Yes, Rails can check a mailbox to see whether anything has come in, and retrieve and process messages.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access