Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View gist:9341b8684c56dccd3513
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
require 'net/smtp'
def sendEmail(to, subject, message)
to=to.to_s()
to.gsub!(" ","")
to.gsub!(";",",")
smtp = Net::SMTP.new('smtp.gmail.com', 587)
smtp.enable_starttls
smtp.start("smtp.gmail.com","myemail@gmail.com","password",:login)
to.split(",").each {|email|
emailMessage = "From: myemail <myemail@gmail.com>
To: <#{email.to_s()}>
Subject: #{subject.to_s()}
Content-Type: text/html;
#{message.to_s()}
"
smtp.send_message(emailMessage.to_s(),"myemail@gmail.com", email.to_s())
}
end
 
t = Thread.new do
sendEmail("myemail@gmail.com","mysubject","mybody")
end
while(t.alive?)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.