actionmailer

Rails 4 mailers with gmail smtp

喜你入骨 提交于 2021-02-19 07:31:12
问题 I want to use the Mailer of Rails 4 with the Gmail's smtp configuration In my development file i set: config.action_mailer.perform_deliveries = true config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :domain => "gmail.com", :user_name => "mymail@gmail.com", :password => "mygmailpassword", :authentication => :plain, :enable_starttls_auto => true } but i don't recive any mails. This is the output of the terminal: To:

how do you test that Rails mailer credentials are valid?

╄→гoц情女王★ 提交于 2021-02-17 19:46:29
问题 I've got a mailer sending through a GMail account, and I want to test that ActionMailer can actually log in to GMail's SMTP server with the credentials I've given it. What's the best way to test this? 回答1: It's not a full-stack solution, but you can check that the server authentication happens correctly by using Net::SMTP directly. The Mail gem that Rails 3 uses to send ActionMailer emails uses Mail like so (with your ActionMailer.smtp_settings): #line 96 of mail-2.2.7/lib/mail/network

Sending emails on user-selected dates

跟風遠走 提交于 2021-02-10 17:59:04
问题 My app involves people coming to a home page, entering a name of a bet they've made (for fun), their email address, a date they would like to be reminded, and some details about the bet. I am using the whenever gem to have this run once a day. bet.rb class Bet < ActiveRecord::Base attr_accessible :details, :email, :name, :reminder, :sent # Sends user a reminder if current_date is equal to the reminder date of the bet def check_bet current_date = Time.now.strftime("%Y-%m-%d").to_s @bets = Bet

Sending emails on user-selected dates

本秂侑毒 提交于 2021-02-10 17:54:11
问题 My app involves people coming to a home page, entering a name of a bet they've made (for fun), their email address, a date they would like to be reminded, and some details about the bet. I am using the whenever gem to have this run once a day. bet.rb class Bet < ActiveRecord::Base attr_accessible :details, :email, :name, :reminder, :sent # Sends user a reminder if current_date is equal to the reminder date of the bet def check_bet current_date = Time.now.strftime("%Y-%m-%d").to_s @bets = Bet

Rails 6.0.2 ActionMailer Issue: Template not found

有些话、适合烂在心里 提交于 2021-01-29 15:07:07
问题 I'm in the development environment. When triggering an email in the UI, I get the error in the browser: No template for interactive request Admins::AdminsController#testmail is missing a template for request formats: text/html NOTE! Unless told otherwise, Rails expects an action to render a template with the same name, contained in a folder named after its controller. If this controller is an API responding with 204 (No Content), which does not require a template, then this error will occur

How do I set the SSL protocol needed for ActionMailer to use a TLS connection?

烈酒焚心 提交于 2020-11-29 03:31:26
问题 I am running into an issue trying to use my campus's SMTP server with my Rails 5.x app. I receive the following error: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol. Here is my configuration: config.action_mailer.smtp_settings = { address: 'address.domain', port: 587, user_name: 'UNAME', password: 'PWD', authentication: :login, tls: true, enable_starttls_auto: true } To ensure I am using the latest openssl version, I have also required 'openssl' in my

Previewing Mailers on non-development tiers

我是研究僧i 提交于 2020-05-28 18:44:35
问题 I have several mailer previews under spec/mailer/previews . On development I can view all the previews under /rails/mailers/ . However by default this functionality does not exist on other environments. I wanted to enable it on the staging environment and took a queue from this post here. I made the following changes - config/routes.rb # Add the routes manually if Rails.env.staging? get "/rails/mailers" => "rails/mailers#index" get "/rails/mailers/*path" => "rails/mailers#preview" end config

Previewing Mailers on non-development tiers

房东的猫 提交于 2020-05-28 18:39:20
问题 I have several mailer previews under spec/mailer/previews . On development I can view all the previews under /rails/mailers/ . However by default this functionality does not exist on other environments. I wanted to enable it on the staging environment and took a queue from this post here. I made the following changes - config/routes.rb # Add the routes manually if Rails.env.staging? get "/rails/mailers" => "rails/mailers#index" get "/rails/mailers/*path" => "rails/mailers#preview" end config

Rails : Net::SMTPAuthenticationError (535 Authentication failed: Bad username / password )

落花浮王杯 提交于 2020-05-27 12:31:30
问题 I'm trying to setup email in my rails application and i'm getting the error "Net::SMTPAuthenticationError (535 Authentication failed: Bad username / password )" when i trigger the mail action in production environment. controller: class FeedbacksController < InheritedResources::Base def create @feedback = Feedback.new(feedback_params) @user = current_user respond_to do |format| if @feedback.save ExampleMailer.sample_email(@user).deliver format.html { redirect_to @feedback, notice: 'feedback

Rails : Net::SMTPAuthenticationError (535 Authentication failed: Bad username / password )

帅比萌擦擦* 提交于 2020-05-27 12:31:08
问题 I'm trying to setup email in my rails application and i'm getting the error "Net::SMTPAuthenticationError (535 Authentication failed: Bad username / password )" when i trigger the mail action in production environment. controller: class FeedbacksController < InheritedResources::Base def create @feedback = Feedback.new(feedback_params) @user = current_user respond_to do |format| if @feedback.save ExampleMailer.sample_email(@user).deliver format.html { redirect_to @feedback, notice: 'feedback