actionmailer

Rails 4 ActionMailer with gmail Net::SMTPAuthenticationError: 534-5.7.14

橙三吉。 提交于 2019-11-29 03:37:24
I am trying to send an email in development version of my app. Nothing I am doing is working. I keep getting hit with: Net::SMTPAuthenticationError: 534-5.7.14 https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=blahblahblah Other SO posts I have followed: Net::SMTPAuthenticationError when sending email from Rails app (on staging environment) Running into SMTP error when trying to send email in RoR app ... etc... and nothing works. I'm going to tear my brains out if can't be resolved. I have spent so long on this... I have tried going directly to http://www.google.com/accounts

undefined method `name' for “actionmailer”:String

橙三吉。 提交于 2019-11-29 03:29:30
I've an old version of Rails project which was built using BrowserCMS in the config/environment file RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION so I installed this gems using rvm so I can run it $ gem list *** LOCAL GEMS *** actionmailer (2.3.8, 2.3.4) actionpack (2.3.8, 2.3.4) activerecord (2.3.8, 2.3.4) activeresource (2.3.8, 2.3.4) activesupport (2.3.8, 2.3.4) bundler (1.1.4) mysql (2.8.1) rack (1.1.3, 1.0.1) rails (2.3.4) rake (0.8.7) I run rake db:create it works fine, but when I run rake db:migrate I got this error rake aborted! undefined method `name' for

ActionMailer sending real emails in test mode! - How to turn off?

泄露秘密 提交于 2019-11-29 02:38:01
问题 Newly signed up users to my little app must be approved by the admin (me) before they can gain access to the site. I've succeeded in generating such emails in development with an after_create :send_admin_email in my user model which works great. My problem is that I'm generating multiple users during my tests (using FactoryGirl) and each test user created sends off a real email. Running my tests is like pouring molasses in January and I've got to delete hundreds of emails sent to my inbox.

Send to multiple recipients in Rails with ActionMailer

天大地大妈咪最大 提交于 2019-11-28 18:33:33
I'm trying to send multiple emails based on a boolean value in my database. The app is a simple scheduling app and user can mark their shift as "replacement_needed" and this should send out emails to all the users who've requested to receive these emails. Trouble is, it only every seems to send to one email. Here's my current code: def request_replacement(shift) @shift = shift @user = shift.user @recipients = User.where(:replacement_emails => true).all @url = root_url @recipients.each do |r| @name = r.fname mail(:to => r.email, :subject => "A replacement clerk has been requested") end end i'm

image_tag in mailer not using asset_host

社会主义新天地 提交于 2019-11-28 18:32:00
image_tag isn't using the asset_host I've set. Any ideas why? The only thing I can think of is it having to do with it being a Mailer. config/environment/development.rb config.action_controller.asset_host = "http://localhost:3000" myMailer.rb <%= image_tag "logo.png", :style=>"margin-left:10px; padding-bottom:15px;" %> rendered as: <img alt="Logo" src="/images/logo.png?1303090162" style="margin-left:10px; padding-bottom:15px;" /> In console: > MyApp::Application.config.action_controller #<OrderedHash {… :asset_host=>"http://localhost:3000", …}> I need the image_tag to create a full path url

Rails ActionMailer with multiple SMTP servers

青春壹個敷衍的年華 提交于 2019-11-28 17:51:30
I have a need to use two different smtp servers in a Rails application. It appears that the way ActionMailer is constructed, it is not possible to have different smtp_settings for a subclass. I could reload the smtp settings for each mailer class whenever a message is being sent, but that messes up the ExceptionNotifier plugin which is outside my control (unless I mess with it too). Does anyone have a solution/plugin for something like this? Ideally I would like to have class UserMailer < ActionMailer::Base; end and then set in environment.rb ActionMailer::Base.smtp_settings = standard_smtp

Sending mail with devise and Gmail smtp server

拈花ヽ惹草 提交于 2019-11-28 16:25:14
I am using Devise :confirmable and :recoverable module to confirm a user and to let him recover his password if he forgets it. Everything is going fine, the mail gets generated and I can see it in the server log, but then I am facing errors and the mail is not delivered to the mailbox. The SMTP settings for my environment.rb file is : require 'tlsmail' Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE) ActionMailer::Base.raise_delivery_errors = true ActionMailer::Base.perform_deliveries = true ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.smtp_settings = { :enable_starttls_auto =>

Rails 4 Net::SMTPAuthenticationError: 535 #5.7.0 Authentication failed

我只是一个虾纸丫 提交于 2019-11-28 13:31:11
I'm building a email list for a student organization at my University. The organization has around 6000 members and to avoid costs I've received permission to use the schools emails servers and they have created an account for me. I have tested the the account using my mail client and everything seems to be working fine, but when I try to send through my Rails 4 app I get the error: Net::SMTPAuthenticationError: 535 #5.7.0 Authentication failed I have it configured like so: application.rb config.action_mailer.smtp_settings = { :address => "smtp.school.edu", :port => 25, :enable_starttls_auto =

actionmailer “from” setting

天涯浪子 提交于 2019-11-28 12:48:13
I am using ActionMailer and in my mailer model, I have a from set like this default :from => "from@example.org" In my environment.rb, I have a different username within ActionMailer::Base.smtp_settings = {} but I'd like the from address to override this.. so that the user sees only that. Is this possible? Additionally, when I change my settings within environment.rb, I don't see my changes take place... do I need to restart my rails server to refresh these settings? === here are some of my settings: ActionMailer::Base.smtp_settings = { :tls => true, :address => "smtp.gmail.com", :port => "587"

Net::OpenTimeout (execution expired) exception with Rails mailer

谁都会走 提交于 2019-11-28 08:47:01
I have problem with delivering emails on production server. When mailer processed new message, calls exception Net::OpenTimeout (execution expired) My smtp settings: #settings.yml production: smtp: address: smtp.gmail.com port: 587 domain: mydomain.net user_name: username@gmail.com password: password authentication: plain enable_starttls_auto: true My environment settings: #production.rb config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = Settings.smtp.symbolize_keys From logs: Sent mail to username@gmail.com (30010.1ms) I, [2014-10-15T12:59:22.371563 #19779] INFO