Skip to content

Instantly share code, notes, and snippets.

@frizop
Created August 8, 2019 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frizop/227c23a3cc478c65ce1af50a1f8eeb62 to your computer and use it in GitHub Desktop.
Save frizop/227c23a3cc478c65ce1af50a1f8eeb62 to your computer and use it in GitHub Desktop.
caught exception
begin
Net::SMTP.start(smtp_address, smtp_port) do |smtp|
smtp.send_message message, smtp_from_address, smtp_to_address
end
rescue Exception => e
Puppet.info("I wasn't able to make the email go")
ensure
smtp.finish
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment