Raveendran

Nothing is impossible…

Main menu

Skip to content

Tag Archives: send gmail ruby

Post navigation

Jun 22 2012

Automatically Sending Email(from Gmail) using tlsmail Ruby gem

-

Installation:

1. Install Ruby
2. Install Ruby gem tlsmail
CMD>gem install tlsmail

Code:

def send_mail_to(to,contents)
require 'rubygems'
require 'tlsmail'
require 'time'
from = 'YOUR_ID@gmail.com'
p = 'GMAIL PASSWORD'

content = <<EOF
From: #{from}
To: #{to}
subject: Test Email
Date: #{Time.now.rfc2822}

#{contents}

Regards,
Your Name
EOF

Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)
Net::SMTP.start(‘smtp.gmail.com’, 587, ‘gmail.com’, from, p, :login) do |smtp|
smtp.send_message(content, from, to)
end
end

send_mail_to(“Receiver Email Id”, “Hi, test Email”)

  Output:

Check Your Sent Items list.

By raveendran • Posted in email, Ruby, Ruby 1.9, tlsmail • Tagged automatic email, automatic gmail using ruby, gem install tlsmail, gmail, gmail ruby mail send, Ruby, ruby gmail, ruby mail, send gmail ruby, send mail ruby, sending mail using ruby, tlsmail
0

Post navigation

Hit Count

  • 109,054 hits

RSS Links

  • RSS - Posts
  • RSS - Comments

My Tags

Acts_as_attachment autoitx3.dll cheat sheet cucumber cuRF error excel gem height highline HTML to PDF image save image scrap Jazzez manual testing pagination pagination in rails plugin in rails QA rails rasta raveendran ror rspec rspec watir Ruby ruby excercise ruby gem ruby gems ruby pdf Ruby solutions ruby watir-webdriver save_images selenium selenium-webdriver selenium-webdriver ruby selenium ide selenium ruby selenium webdriver code Spreadsheet Testing watir watir-webdriver web driver width

bankbazaar

  • BankBazaar

Personal

  • Muthu Selvan
  • Political Lines
  • Self Confidence
  • Srikanth

What I am doing ?

  • Configuration Management using YAML file for Watir/Selenium web-driver related frameworks wp.me/p5FW9-ce 8 months ago
  • Convert HTML webpage to PDF using WatirWebDriver + Pdfcrowd http://wp.me/p5FW9-ca 8 months ago
  • Custom HTML report for Ruby(Watir/Selenium) Base Automation framework wp.me/p5FW9-c6 8 months ago
http://www.box.net/static/flash/widget_player.swf

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 22 other followers

Blog at WordPress.com. | Theme: iTheme2 by Themify.
Follow

Get every new post delivered to your Inbox.

Powered by WordPress.com