From 445b6879accb203777ef4592c6c98ab00db25157 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Fri, 6 Dec 2019 10:18:17 +0100 Subject: [PATCH] main: format --- main.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/main.rb b/main.rb index 707a0635..bf1f8010 100755 --- a/main.rb +++ b/main.rb @@ -4,29 +4,29 @@ require 'net/smtp' # Inputs -address = ENV["INPUT_SERVER_ADDRESS"] -port = ENV["INPUT_SERVER_PORT"] -username = ENV["INPUT_USERNAME"] -password = ENV["INPUT_PASSWORD"] -subject = ENV["INPUT_SUBJECT"] -body = ENV["INPUT_BODY"] -to = ENV["INPUT_TO"] -from = ENV["INPUT_FROM"] +address = ENV['INPUT_SERVER_ADDRESS'] +port = ENV['INPUT_SERVER_PORT'] +username = ENV['INPUT_USERNAME'] +password = ENV['INPUT_PASSWORD'] +subject = ENV['INPUT_SUBJECT'] +body = ENV['INPUT_BODY'] +to = ENV['INPUT_TO'] +from = ENV['INPUT_FROM'] # Message -message = < +message = <<~END_OF_MESSAGE + Subject: #{subject} + From: #{from} <#{username}> -#{body} -EOM + #{body} +END_OF_MESSAGE # Send begin smtp = Net::SMTP.new(address, port.to_i) smtp.enable_tls smtp.start(address, username, password, :login) - smtp.send_message(message, username, to.split(",")) + smtp.send_message(message, username, to.split(',')) rescue StandardError => e puts "Error: #{e.message}" exit 1