vendredi 30 septembre 2016

Cant Send email from outlook using ruby script

so this is code works fine with yahoo and gmail but it throws an error when i run it with using outlook smtp

  `require 'mail'



   options =   { 
           :address        => 'smtp.live.com',
           :port           => '587',
           :authentication => :login,
           :user_name      => ENV['mymail@outlook.com'],
           :password       => ENV['mypassword'],
           :enable_starttls_auto => true
                   }




Mail.defaults do
delivery_method :smtp, options
end



Mail.deliver do

to 'test@gmail.com'
from 'mymail@outlook.com'
subject 'test'
body 'outlook'
end

`

when i execute this script it gives me "untitled.rb: end of file reached (EOFError)" this error ,i would really appreciate your help

Aucun commentaire:

Enregistrer un commentaire