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

  • SEARCH
  • Home
  • 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 8705409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:21:07+00:00 2026-06-13T03:21:07+00:00

I am using the mail gem for Ruby https://github.com/mikel/mail How do I send an

  • 0

I am using the mail gem for Ruby https://github.com/mikel/mail

How do I send an email via an smtp server? How do I specify the address and port? And what settings should I use for Gmail?

The README on github only gives examples sending by a local server.

  • 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-06-13T03:21:08+00:00Added an answer on June 13, 2026 at 3:21 am

    From http://lindsaar.net/2010/3/15/how_to_use_mail_and_actionmailer_3_with_gmail_smtp

    To send out via GMail, you need to configure the Mail::SMTP class to have the correct values, so to try this out, open up IRB and type the following:

    require 'mail'
    
    options = { :address              => "smtp.gmail.com",
                :port                 => 587,
                :domain               => 'your.host.name',
                :user_name            => '<username>',
                :password             => '<password>',
                :authentication       => 'plain',
                :enable_starttls_auto => true  }
    
    
    
    Mail.defaults do
      delivery_method :smtp, options
    end
    

    The last block calls Mail.defaults which allows us to set the global delivery method for all mail objects that get created from now on. Power user tip, you don’t have to use the global method, you can define the delivery_method directly on any individual Mail::Message object and have different delivery agents per email, this is useful if you are building an application that has multiple users with different servers handling their email.

    Mail.deliver do
           to 'mikel@test.lindsaar.net'
         from 'ada@test.lindsaar.net'
      subject 'testing sendmail'
         body 'testing sendmail'
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i've been using ruby pony gem to send emails https://github.com/benprew/pony#readme unfortunately documentation is not
I'm using the mail gem from https://github.com/mikel/mail I use it to parse raw mail
I'm using Ruby script and the mail gem to send emails. Question - How
I'm trying to read an email using ruby mail gem. But mail.body.decoded returns me
i am using mail class to send email with attachment as image to multiple
I am trying to send email using mail() in php. I need the message
i am using mail() function to send email from PHP without any authentication. This
once we send email from php using mail() function, is there any way to
I am using mail message class to send an email. But if i check
I'm using the mailmain gem to grab pop3 mail. This library uses the mail

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.