Skip to content

Instantly share code, notes, and snippets.

@dnshl
Created February 29, 2012 13:29
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 dnshl/1940841 to your computer and use it in GitHub Desktop.
Save dnshl/1940841 to your computer and use it in GitHub Desktop.
Ruby SMTP email template
#!/usr/bin/env ruby
require 'net/smtp'
from = ""
to = ""
smtp_server = ""
port = 25
username = ""
password = ""
message = <<MESSAGE_END
From: from <>
To: to <>
Subject:
text
MESSAGE_END
Net::SMTP.start(smtp_server, port, "localhost", username, password, :login) do |smtp|
smtp.send_message message, from, to
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment