Skip to content

Instantly share code, notes, and snippets.

@radiospiel
Created October 26, 2016 10:50
Show Gist options
  • Save radiospiel/8c90fca0bb25acafb1fbb4bc2a85927d to your computer and use it in GitHub Desktop.
Save radiospiel/8c90fca0bb25acafb1fbb4bc2a85927d to your computer and use it in GitHub Desktop.
require "mail"
mail = Mail.new do
to 'nicolas@test.lindsaar.net.au'
from 'Mikel Lindsaar <mikel@test.lindsaar.net.au>'
subject 'First multipart email sent with Mail'
text_part do
body 'Find my source code attached'
end
html_part do
content_type 'text/html; charset=UTF-8'
body 'Find my <b>source code</b> attached'
end
attachments['xxx'] = { mime_type: "bla", content: File.read(__FILE__) }
end
puts mail.to_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment