Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- require 'mail'
- def sendEmail
- options = { :address => "smtp.gmail.com",
- :port => 587,
- :domain => <domain>,
- :user_name => <username>,
- :password => <password>,
- :authentication => 'plain',
- :enable_starttls_auto => true }
- Mail.defaults do
- delivery_method :smtp, options
- end
- Mail.deliver do
- to "asdf@asdf.co"
- from "asdf@asdf.net"
- cc "asdf@asdf.org"
- bcc "asdf@asdf.com"
- subject "Test"
- body "Body."
- end
- end
- if __FILE__ == $0
- #if running as script
- sendEmail
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement