Skip to content

Instantly share code, notes, and snippets.

@9876691
Created March 2, 2010 16:13
Show Gist options
  • Save 9876691/319624 to your computer and use it in GitHub Desktop.
Save 9876691/319624 to your computer and use it in GitHub Desktop.
def send_email(from, from_alias, to, to_alias, subject, message)
msg = <<END_OF_MESSAGE
From: #{from_alias} <#{from}>
To: #{to_alias} <#{to}>
Subject: #{subject}
#{message}
END_OF_MESSAGE
Net::SMTP.start('localhost') do |smtp|
smtp.send_message msg, from, to
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment