actionmailer

why is authentication: 'plain' the default setting for actionmailer in rails (with gmail smtp)?

耗尽温柔 提交于 2019-12-06 01:46:13
问题 I am reading up on actionmailer for rails. My question is about the default settings as described here: config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :domain => 'baci.lindsaar.net', :user_name => '<username>', :password => '<password>', :authentication => 'plain', :enable_starttls_auto => true } now reading from the API here it says that: ":authentication - If your mail server requires authentication, you need

Rails 2.3.9 and SendGrid, Connection refused - connect(2) on localhost

邮差的信 提交于 2019-12-05 23:24:45
I've looked through Google and StackOverflow and can't figure this out. I've got a Rails 2.3.9 app using Ruby 1.8.7, trying to send email through SMTP like so: ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.smtp_settings = { :address => "smtp.sendgrid.net", :port => '25', :domain => "************.com", :authentication => :plain, :user_name => "***********", :password => "**********" } My app backtrace looks like this: /Users/jared/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/net/smtp.rb:551:in `initialize' /Users/jared/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/net/smtp.rb:551:in

Rails 3/Devise confirmation email server settings

你说的曾经没有我的故事 提交于 2019-12-05 21:59:12
问题 I have a Rails 3 app and I'm using Devise for user authentication. How do I specify an application-wide SMTP server for Devise to use? I've entered the following into /config/environments/development.rb (Apache2 is set to 8080) config.action_mailer.default_url_options = { :host => 'mydomain.com:8080' } Any ideas on how to get outgoing mail to work with Devise and Rails 3? 回答1: Devise uses ActionMailer to send emails so you have to configure it. Take a look at this tutorial for an example of

Can I send email from different addresses using same ActionMailer

假如想象 提交于 2019-12-05 18:25:26
I'm using ActionMailer for my Rails 2.3.9 application. When I send an email using: deliver_user_invite config: def user_invite(subject, content) subject subject from "User Invite <invite@mydomain.com>" recipients "invites@mydomain.com" sent_on Time.now content_type "text/html" body :content => content end with SMTP configuration config.action_mailer.smtp_settings = { :enable_starttls_auto => true, :address => 'smtp.gmail.com', :port => 587, :domain => 'mydomain.com', :authentication => :plain, :user_name => 'user@mydomain.com', :password => 'password' } However when the email is sent, the

Rails ActionMailer w/ Devise + Google Apps in Development Mode

Deadly 提交于 2019-12-05 13:26:01
I'm trying to configure ActionMailer to send mail from Devise in development mode with my Google Apps account. I've added the following to my config/environments/development.rb file, but it looks like mail is not being sent. Note: this is for Google Apps, not Gmail (but the Gmail servers should work -- they do in my mail client). Anything jump out as strange in my config? config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :enable_starttls_auto => true, :address => "smtp.gmail.com", :port => 587, :domain => "mydomain.com", :authentication => :login, :user_name =

Actionmailer not delivering mail, with rails 3

血红的双手。 提交于 2019-12-05 11:44:47
问题 I am trying to make an application, that sends an email when user registers. i put in the smtp settings for gmail in the config/application.rb file and the mail function looks like mail(:to => "me@me.com", :subject => "Mail!", :from => "another@me.com", :content_type => "text/html") now when i see the logs, i see that it says mail has been sent, but i never receive any mail at all... also, when i call the mail deliver function, Emails.signed(@user).deliver , the form page does not redirect,

Gmail does not detect the reply-to field

拟墨画扇 提交于 2019-12-05 11:25:25
问题 I have following settings in my FeedbackMailer . def notification(feedback) from "admin@gmail.com" subject "Some feedback" recipients "admin@gmail.com" reply_to feedback.creator.email body({ :feedback => feedback }) content_type "text/html" end I am using admin@gmail.com account to send emails for this application. The emails are delivered perfectly. And when I check the details of the email after receiving it, I see following: from "admin@gmail.com" reply-to "user_email@foo.com" to "admin

Action::Mailer not delivering mail to the recepients

ぃ、小莉子 提交于 2019-12-05 11:15:51
I tried to send mail to the user when his profile is being viewed. i.e When a user clicks on show of a particular contact that contact will be notified about the profile view. I did not get any errors. But there is some delay where i have triggered the mailer. And also it works fine in the console. But the mail is not being sent to the recepient. This is what I have tried so far. mailer.rb : class CustomerSupport < ActionMailer::Base def customer_support(contact) mail :to => contact.email, :from => "sugukvs92@gmail.com", :subject => "profileviews" end end setup_mail.rb ActionMailer::Base

Rails: change default sender in action mailer

纵饮孤独 提交于 2019-12-05 11:13:08
I am sending email using action mailer in my rails app. But it allows only one default sender. This is my UserMailer class: class UserMailer < ActionMailer::Base default :from => "example@example.com" def welcome_email(user, order) @user = user @order = order mail(:to => user.email, :subject => "Your Order") end def signup_email(user) @user = user mail(:to => user.email, :subject => "Thank you.") end def invite_confirm(curuser,usemail,post) @greeting = "Hi" @user = curuser @post = post mail(:to => user.email, :subject => "Hello") end end I tried this: class UserMailer < ActionMailer::Base def

Execute pending job with ActiveJob in rspec

不问归期 提交于 2019-12-05 10:52:35
问题 I have this code to test ActiveJob and ActionMailer with Rspec I don't know how really execute all enqueued job describe 'whatever' do include ActiveJob::TestHelper after do clear_enqueued_jobs end it 'should email' do expect(enqueued_jobs.size).to eq(1) end end 回答1: Here is how I solved a similar problem: # rails_helper.rb RSpec.configure do |config| config.before :example, perform_enqueued: true do @old_perform_enqueued_jobs = ActiveJob::Base.queue_adapter.perform_enqueued_jobs @old_perform