Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 310019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:47:42+00:00 2026-05-12T07:47:42+00:00

Does anyone have any quality (and up-to-date) information regarding sending mail via Gmail using

  • 0

Does anyone have any quality (and up-to-date) information regarding sending mail via Gmail using Ruby’s Net::SMTP? I’ve seen several examples — most dating from 2007 to mid-2008 and none of them work for me. I need more current examples that use the most recent 1.8.7 release. I’d also appreciate if the documentation didn’t only cover simple examples that no one ever really uses.

Currently I’m receiving an error:

 SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol

I’m not terribly familiar with SSL as regards the SMTP protocol, so this is all lost on me. Unfortunately the Net::SMTP documentation only covers the bases and doesn’t provide a full list of the various potential OpenSSL::SSL contexts either so I can’t try various ones.

Anyway, if anyone has any quality info on getting this to work with Gmail it would be most appreciated.

Best.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:47:43+00:00Added an answer on May 12, 2026 at 7:47 am

    I actually just got this working. Wrote a quick script to test it.

    I was getting a different error than you were (requiring STARTTLS), I also found I had to use port 587 instead of 465.

    I found the trick to get it working in a Rails plugin I found. (agilewebdevelopment.com/plugins/net_smtp_tls_support)

    if you ‘eval’ this file (it adds tls support to the standard Net::SMTP library):

    http://happiness-is-slavery.net/wp-content/rails-plugins/smtp_add_tls_support/lib/smtp_add_tls_support.rb

    then run ‘Net::SMTP.enable_tls()’

    everything seems to work fine.

    Here’s my code:

    require 'rubygems'
    require 'net/smtp'
    
    eval File.read("smtp_tls.rb")
    Net::SMTP.enable_tls() 
    FROM_EMAIL = "REMOVED"
    PASSWORD = "REMOVED"
    TO_EMAIL = "REMOVED"
    
    msgstr = <<END_OF_MESSAGE
    From: Your Name <#{FROM_EMAIL}>
    To: my phone <#{TO_EMAIL}>
    Subject: text message
    Date: Sat, 23 Jun 2001 16:26:43 +0900
    Message-Id: <unique.message.id.string@example.com>
    
    This is a test message.
    END_OF_MESSAGE
                        
    Net::SMTP.start('smtp.gmail.com', 587, 'gmail.com',
                          FROM_EMAIL, PASSWORD, :plain) do |smtp|
      smtp.send_message msgstr, FROM_EMAIL, TO_EMAIL
    end
    

    obviously, i downloaded the above mentioned file to the same directory and named it ‘smtp_tls.rb’

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone have any insights regarding compiling Ruby code for Windows? I've tried both
Does anyone have any quality resources for some free (or cheap) DotNetNuke skins? Most
Does anyone have any recommendations for implementations of ActiveRecord in PHP? I've been using
Does anyone have any recommendations of tools that can be of assistance with moving
Does anyone have any experience getting MSTest to copy hibernate.cfg.xml properly to the output
Does anyone have any practical suggestions about how to manage feature creep in GUIs?
Does anyone have any suggestions on how to mentor a junior programmer ? If
Does anyone have any tips for dealing with ConstraintExceptions thrown by XSD datasets? This
Does anyone have any good starting points for me when looking at making web
Does anyone have any tips or gotcha moments to look out for when trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.