Send email from Ruby
Here I will show you how to send email through ruby script.
Require NET/SMPT library in ruby script
require 'net/smtp'
Config SMTP authentication
def send_email(to,opts={})
opts[:server] ||= 'SERVER IP'
opts[:port] ||= PORT_NUMBER
opts[:domain] ||= "DOMAIN IP"
opts[:user_name] ||="USERNAME"
opts[:password] ||= "PASSWORD"
opts[:authentication] ||="plain"
opts[:from] ||= 'example@domain.com'
opts[:from_alias] ||= 'FROM NAME'
opts[:subject] ||= "SUBJECT SAMPLE"
opts[:body] ||= "MESSAGE BODY"
msg = <<END_OF_MESSAGE
From: #{opts[:from_alias]} <#{opts[:from]}>
To: <#{to}>
Subject: #{opts[:subject]}
Content-type: text/html
#{opts[:body]}
END_OF_MESSAGE
Net::SMTP.start(opts[:server],opts[:port], opts[:domain],opts[:user_name], opts[:password],opts[:authentication]) do |smtp|
smtp.send_message msg, opts[:from], to
end
end
Now send email by passing arguments.
send_email "EMAIL ADDRESS", :body => "MESSAGE"
I hope this will helps you to send email through script.

















China visa…
[...]check below, are some totally unrelated websites to ours, however, they are most trustworthy sources that we use[...]…
hai