1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

How to Send Email with Ruby

By

To compose the email messages, you need to know a little bit about email and SMTP. An email message is composed of a number of headers and a body. However, you can get by with the minimum of headers, since the only headers required to make a sensible email messages are From (who is the message from?), To (who is the message to?) and Subject (the subject line of the message). Compose the email message in a string. Since emails are multi-line messages, it's recommended you use a heredoc or the DATA stream, both of which are demonstrated in the example programs.

  1. About.com
  2. Technology
  3. Ruby
  4. Tutorials
  5. Composing the Message

©2014 About.com. All rights reserved.