diff --git a/app/helpers/ReadingsMailer.rb b/app/helpers/ReadingsMailer.rb new file mode 100644 index 0000000..c350a45 --- /dev/null +++ b/app/helpers/ReadingsMailer.rb @@ -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 ' + 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 '

This is HTML

' + end + end + + mail.deliver! + end + end +end \ No newline at end of file