Created
August 27, 2015 08:31
-
-
Save tripolitrax/0cdbb1ef089176713fbf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/smtp' | |
def send_email(subj, message, supportMail="mail@address1; mail@address2") | |
supportMail = ENV['SUPPORT'] unless ENV['SUPPORT'] == nil | |
message = "From: Validation <root@#{Socket.gethostname}> | |
To: ${supportMail} | |
Content-type: text/html | |
Subject: #{subj} | |
Date: #{Time.now} | |
#{message}" | |
Net::SMTP.start("127.0.0.1", 25) do |smtp| | |
smtp.send_message message, "root@#{Socket.gethostname}", | |
"#{supportMail}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment