actionmailer

Rails 3 ActionMailer and Wicked_PDF

匆匆过客 提交于 2019-11-28 06:23:44
I'm trying to generate emails with rendered PDF attachements using ActionMailer and wicked_pdf. On my site, I'm using already both wicked_pdf and actionmailer separately. I can use wicked_pdf to serve up a pdf in the web app, and can use ActionMailer to send mail, but I'm having trouble attaching rendered pdf content to an ActionMailer (edited for content): class UserMailer < ActionMailer::Base default :from => "webadmin@mydomain.com" def generate_pdf(invoice) render :pdf => "test.pdf", :template => 'invoices/show.pdf.erb', :layout => 'pdf.html' end def email_invoice(invoice) @invoice =

Rails Mailer “Net::OpenTimeout: execution expired” Exception on production server only

。_饼干妹妹 提交于 2019-11-28 06:14:27
I am using Ruby MRI 2.0.0 and Rails 3.2.12 on a Ubuntu 12.04 TLS VPS and attempting to setup email notifications in my app. It was working fine a few days ago, but not anymore. My web host is OVH. My SMTP settings: config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors = true ActionMailer::Base.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :user_name => 'sender@gmail.com', :password => 'secret', :authentication => 'plain', :enable_starttls_auto => true } Using RAILS_ENV=production rails console : class MyMailer < ActionMailer::Base def test

Sendgrid / email sending issues in Ruby on Rails (hosted on Heroku)

独自空忆成欢 提交于 2019-11-28 05:04:24
im having a problem getting sendgrid to send emails successfully on a rails 3.1 app that's using authlogic for authentication and is being deployed on heroku. i have the following action mailer configuration on config/environments/[development.rb and production.rb]: config.action_mailer.delivery_method = :smtp config.action_mailer.default_url_options = { :host => 'localhost:3000' } config.action_mailer.default_charset = "utf-8" config.action_mailer.raise_delivery_errors = true config.action_mailer.perform_deliveries = true config.action_mailer.smtp_settings = { :address => 'smtp.sendgrid.net',

Contact Form Mailer in Rails 4

你离开我真会死。 提交于 2019-11-28 04:44:33
I am trying to build a contact form in Rails 4, where the form takes a name, email, and body and sends it to my email address. Upon clicking "Submit", the app redirects back to the Contact page correctly, but no email appears to get sent. routes.rb match '/send_mail', to: 'contact#send_mail', via: 'post' contact_email.html.erb <!DOCTYPE html> <html> <head> <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> <%= javascript_include_tag "application", "data-turbolinks-track" => true %> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <

Problem sending multipart mail using ActionMailer

家住魔仙堡 提交于 2019-11-28 04:43:24
I'm using the following code to send emails in rails: class InvoiceMailer < ActionMailer::Base def invoice(invoice) from CONFIG[:email] recipients invoice.email subject "Bevestiging Inschrijving #{invoice.course.name}" content_type "multipart/alternative" part "text/html" do |p| p.body = render_message 'invoice_html', :invoice => invoice end part "text/plain" do |p| p.body = render_message 'invoice_plain', :invoice => invoice end pdf = Prawn::Document.new(:page_size => 'A4') PDFRenderer.render_invoice(pdf, invoice) attachment :content_type => "application/pdf", :body => pdf.render, :filename =

Rails and Gmail SMTP, how to use a custom from address

[亡魂溺海] 提交于 2019-11-28 03:39:51
问题 I've got my Rails (2.1) app setup to send email via Gmail, however whenever I send an email no matter what I set the from address to in my ActionMailer the emails always come as if sent from my Gmail email address. Is this a security restriction they've put in place at Gmail to stop spammers using their SMTP? Note: I've tried both of the following methods within my ActionMailer (just in case): @from = me@mydomain.com from 'me@mydomain.com' 回答1: I believe it's just something Gmail does when

Setting up a Gmail Account to work with ActionMailer in Rails 3

不问归期 提交于 2019-11-28 03:28:02
I have a contact page form that is setup to send an email to a Gmail account. Only problem is it won't send. I believe I have narrowed the error down to my settings inside of the initializers directory. These are my current settings for trying to setup a standard gmail account to send mail: Could it be that my domain setting is wrong or should I be typing in myemail@gmail.com for :user_name ? This is the first time I have used ActionMailer so I don't really know what I am doing. Can somebody please help me out!? Thanks! If you are using the development environment, change the development.rb to

Actionmailer not working when I change gmail password

对着背影说爱祢 提交于 2019-11-28 01:46:12
I have a Rails app that uses Gmail to send Actionmailer emails. It has been working great for months, but now that I changed my Gmail password it has stopped working and I get an error: Net::SMTPAuthenticationError (535-5.7.8 Username and Password not accepted. I've adjusted the new password in my production.rb and development.rb files: config.action_mailer.smtp_settings = { address: 'smtp.gmail.com', port: 587, #domain: 'thetens.us', user_name: 'myaddress@gmail.com', password: 'mypassword', authentication: 'plain', enable_starttls_auto: true } I'm sure the password is correct. Is there some

Sending email from Gmail Rails 3

 ̄綄美尐妖づ 提交于 2019-11-28 01:10:22
问题 I'm trying to send an email through my gmail account. I copied the code directly from the rails guide, and in my terminal it's saying that it is sending the message however, the address I'm sending it to is not getting it. Here is the code I have in my env.rb file config.action_mailer.deconfig.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :domain => 'derp' :user_name => 'derp.bot', :password => 'derp42069',

Errno::ECONNREFUSED: Connection refused - connect(2) for action mailer

倾然丶 夕夏残阳落幕 提交于 2019-11-27 21:47:47
I have been working with rails since a long. Now I am facing a small issue in the ActionMailer. I want to send an email when user gets registered to confirm his registration. I am able to send email in the development mode but where as not in the production mode. the exception Errno::ECONNREFUSED: Connection refused - connect(2) is coming everytime when deliver method is called. I have written the following code. My SMTP config looks: config.action_mailer.default_url_options = { :host => "localhost:3000" } config.action_mailer.delivery_method = :smtp config.action_mailer.perform_deliveries =