Skip to content

Instantly share code, notes, and snippets.

@Benedikt1992
Created August 27, 2017 09:39
Show Gist options
  • Save Benedikt1992/694f066802d63fa06fec3b52e6b9e506 to your computer and use it in GitHub Desktop.
Save Benedikt1992/694f066802d63fa06fec3b52e6b9e506 to your computer and use it in GitHub Desktop.
ruby send mails with 'mail'
#!/usr/bin/env ruby
require 'mail'
def send_mail(content)
mail = Mail.new do
from 'mail@example.com'
to 'recipient@domain.com'
subject "Subject"
body content
end
mail.delivery_method :sendmail
mail.deliver
end
send_mail('Hallo :)')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment