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 6232243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:05:02+00:00 2026-05-24T10:05:02+00:00

When using SMTP settings in Rails for sending e-mail, you need to provide a

  • 0

When using SMTP settings in Rails for sending e-mail, you need to provide a username and password for it to send email from your account. But isn’t it a little dangerous to put your password to the site’s email account in plain text in your code? Is there a more secure way to do this?

config.action_mailer.smtp_settings = {
        :address => "address_here",
        :port => 'port_#_here',
        :domain => "example.com",
        :authentication => :plain,
        :user_name => "user@example.com",
        :password => "foobar",
        :enable_starttls_auto => true
  }
  • 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-24T10:05:02+00:00Added an answer on May 24, 2026 at 10:05 am

    This is probably not much of an issue for the development environment, as you might be using a server that doesn’t require authentication or a dummy account of some sort.

    For the production environment the pattern I have seen/used most often is to keep information like usernames, passwords etc. within the environment itself e.g.:

    config.action_mailer.smtp_settings = {
            :address => "address_here",
            :port => 'port_#_here',
            :domain => "example.com",
            :authentication => :plain,
            :user_name => ENV['EMAIL_USERNAME'],
            :password => ENV['EMAIL_PASSWORD'],
            :enable_starttls_auto => true
      }
    

    This way an attacker will have to gain access to your production box itself in order to get this info. If you’re deploying your app to Heroku for example and using the Sendgrid plugin for you email – the plugin will make you follow that pattern.

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

Sidebar

Related Questions

I'm using the following method to send mail from Python using SMTP. Is it
I need to send mail daily using smtp and asp.net.
I'm using my Gmail Apps for Domain account to send email within my rails
I am sending emails from my website using codeigniters email helper (SMTP) Emails are
I am able to ping smtp.mail.yahoo.com from my system but when i send email
I'm using JavaMail to send email requests to an SMTP server. I'm setting both
I am trying to send email using smtp authentication through google but I am
I am using the Gmail SMTP server to send out emails from users of
I'm having trouble sending email using my gmail account. I'm pulling my hair out.
I'm trying to send mails through rails using Action Mailer and the Googlemail-SMTP-server, but

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.