Skip to content

Instantly share code, notes, and snippets.

@jasper-lyons
Created April 24, 2018 10:22
Show Gist options
  • Save jasper-lyons/9dc2666c471b168ae048f7d9d19f427e to your computer and use it in GitHub Desktop.
Save jasper-lyons/9dc2666c471b168ae048f7d9d19f427e to your computer and use it in GitHub Desktop.
Send email, in ruby with mail gem through microsoft email accounts!
require 'mail'
Mail.defaults do
delivery_method :smtp, {
address: 'smtp.live.com',
port: 587,
user_name: '<your email>',
password: '<your password>',
authentication: :login,
enable_starttls_auto: true
}
end
Mail.deliver do
from '...'
to '...'
subject '...'
body '...'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment