Created
August 27, 2017 09:39
-
-
Save Benedikt1992/694f066802d63fa06fec3b52e6b9e506 to your computer and use it in GitHub Desktop.
ruby send mails with 'mail'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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