Skip to content

Instantly share code, notes, and snippets.

@novemberkilo
Created October 14, 2010 10:26
Show Gist options
  • Save novemberkilo/625990 to your computer and use it in GitHub Desktop.
Save novemberkilo/625990 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'mail'
mail = Mail.new do
to '[email protected]'
from '[email protected]'
subject 'Plain text email - constructed in Ruby'
end
text_part = Mail::Part.new do
body 'This is plain text'
end
mail.text_part = text_part
puts "mail has #{mail.part.length.to_s} parts"
puts "---"
mail.part.each do |x|
puts x.to_s
puts "---"
end
puts "mail has #{mail.part.length.to_s} parts"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment