mail results

This commit is contained in:
Aart van Halteren
2013-08-08 23:01:44 +02:00
parent 6fd8b79e1c
commit ceaaddb55e

View File

@@ -0,0 +1,37 @@
require "mail"
class ReadingsMailer
OPTIONS = { :address => "mail.van-halteren.net",
:port => 465,
:domain => 'van-halteren.net',
:user_name => 'aart@van-halteren.net',
:password => '',
:authentication => 'plain',
:enable_ssl => true}
#
# Class methods
#
class << self
def deliver
mail = Mail.new do
#delivery_method :smtp, OPTIONS
to 'aart@van-halteren.net'
from 'SmartMeter <aart@van-halteren.net>'
subject 'First multipart email sent with Mail'
text_part do
body 'This is plain text'
end
html_part do
content_type 'text/html; charset=UTF-8'
body '<h1>This is HTML</h1>'
end
end
mail.deliver!
end
end
end