actionmailer

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

南笙酒味 提交于 2019-12-29 01:34:13
问题 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

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

柔情痞子 提交于 2019-12-28 13:36:14
问题 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

How to catch error exception in ActionMailer

◇◆丶佛笑我妖孽 提交于 2019-12-28 05:23:04
问题 The problem is how can I catch exception in delivering mail by ActionMailer. For me it sounds impossible, because in this case ActionMailer should sent mail to mailserver, and if mailserver returns error, ActionMailer should show me this error. I am interested only in counting undelivered mails. Do you have any ideas how to implement this? Thanks! 回答1: I'm using something like this in the controller: if @user.save begin UserMailer.welcome_email(@user).deliver flash[:success] = "#{@user.name}

can't generate delete link in rails mailing view

痴心易碎 提交于 2019-12-24 13:23:29
问题 In my view I have 2 links: one for edit, that works great, and one for destroy action. metod looks like: def create_ticket(ticket) @ticket = ticket @edit = edit_ticket_url(@ticket, :host => "localhost:3000", :guest_password => @ticket.guest_password) @destroy = ticket_url(@ticket, :host => "localhost:3000", :guest_password => @ticket.guest_password) mail(:to => @ticket.email, :subject => @ticket.subject) end in view template: <%= link_to "Edit Ticket", @edit %> <%= link_to "Delete Ticket",

Where i can read complete manual to configure SMTP for Rails?

丶灬走出姿态 提交于 2019-12-24 08:34:33
问题 I newbie in Rails, and i have some question. I setup simple application with Devise plugin, deploy it on production server (Ubuntu on Linode, nginx + passenger) via Capistrano. And now try to send emails (password recovery, email confirmation and etc from Devise). But it doesent work. I have this lines in /enviroments/production.rb config.action_mailer.default_url_options = { :host => "myhostname.com" } config.action_mailer.delivery_method = :smtp config.action_mailer.raise_delivery_errors =

wicked_pdf not loading header or footer in ActionMailer

假装没事ソ 提交于 2019-12-24 07:38:31
问题 I'm trying to generate a pdf with the following code: archivo = render_to_string( :pdf => "formulario_de_registro.pdf", :template => 'pdf/profile_download.pdf.haml', :layout => 'pdf/body.pdf.haml', :margin => { :bottom => 40, :top => 30 }, :header => { :html => { :template => 'layouts/pdf/header.pdf.haml'}, :font_size => 13}, :footer => { :html => { :template => 'layouts/pdf/footer.pdf.haml'}, :line => true} ) # from here is just for debugging purposes save_path = Rails.root.join('tmp',

Attach Prawn pdf to email

一世执手 提交于 2019-12-24 00:15:13
问题 I have been searching for ages and I still cant seem to figure this out, I am currently using the prawn gem and I want to be able to attach a pdf to an email in my invoice controllers create action . I am currently able to link to a generated pdf from my invoices/show page through http://localhost:3000/invoices/297.pdf but I cant figure out how to attach this pdf to an email. Currently I am not storing the generated PDF anywhere and my mailer looks like this Mailer class InvoiceMailer <

Rails actionmailer open host email app

和自甴很熟 提交于 2019-12-23 22:34:40
问题 From a link, I want to open up the user's default mail app, with an attachment attached, and the 'To' field empty, and some pre-populated text in the subject and body. Using ActionMailer, I am able to get it to send from my gmail account, but it doesn't open up the default email app. Here are my settings in the ActionMailer::Base.smtp_settings: ActionMailer::Base.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :domain => "gmail.com", :user_name => "myname", :password =>

Ruby: Mail gem add \r\n after 60 chars in mail

泄露秘密 提交于 2019-12-23 10:44:42
问题 I want to port actionmailer_x509 to Rails 3. In order to do that I try to create Mail object from big string with signed email. You can see such creation on this line: https://github.com/petRUShka/actionmailer_x509/blob/master/lib/actionmailer_x509.rb#L129 Original string ( smime0 ): https://gist.github.com/1d2c84cc2e255be010a6 Resulted Mail object dumped to file( newm ): https://gist.github.com/4682fe88e8dcfeca60b2 For example, you can see the difference between line 26 of smime0 and line 40

Ruby: Mail gem add \r\n after 60 chars in mail

≡放荡痞女 提交于 2019-12-23 10:43:07
问题 I want to port actionmailer_x509 to Rails 3. In order to do that I try to create Mail object from big string with signed email. You can see such creation on this line: https://github.com/petRUShka/actionmailer_x509/blob/master/lib/actionmailer_x509.rb#L129 Original string ( smime0 ): https://gist.github.com/1d2c84cc2e255be010a6 Resulted Mail object dumped to file( newm ): https://gist.github.com/4682fe88e8dcfeca60b2 For example, you can see the difference between line 26 of smime0 and line 40