actionmailer

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

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 th...

Rails - setting multiple layouts for a multipart email with mailer templates

Hi there, So Rails 2.2 added mailer layouts, which is great, except that I can't figure out how to make them work when I'm sending a multipart email..it's wrapping my mail content with the same layout for both the text/plain version and the text/html version. What I want is to wrap my layout around either only the text/html version, or...

Complete Sample for ActionMailer to send email with GMAIL

I would like to test my ActionMailer class, but don't have an smtp server. I would like to use gmail to send such emails. Could someone provide a sample with all the necessary configurations both on google and whatever config files in the app. thanks ...

How do I create email with css and images from Rails?

How do you create and send emails from Rails application, that contain images and proper formatting? like the ones you get from facebook and like. ...

ActionMailer problem- what is the correct syntax for sending PDF attachments

What is the correct syntax for sending an email with actionmailer that includes some PDF file attachments? I am using Gmail for SMTP, with the TLS plugin. Here is what I have so far (and have tried variations on this too): **lead_mailer.rb:** def auto_response(lead) recipients lead.email subject "Information" body ...

Multisite support for ActionMailer

There exists the multisite plugin (http://github.com/dasil003/rails-multisite/tree/master) that allows for multiple view folders based on different sites. It especially allows you to only overwrite certain views in a site and leave the others untouched (i.e. the other views don't exist twice). Does something like this exist for ActionMa...

ActionMailer and Ramaze

Is it possible to use ActionMailer in a web framework like Ramaze, or do I need to use Rails? ...

How do I configure the hostname of a Rails app?

I'm working on a fairly traditional forgot password email - I want to email the user a password change token embedded in a link that they can click on in order to change their password. I'm emailing via the traditional ActionMailer. If I use a normal link_to tag <%= link_to "click here", :controller => foo, :action => 'bar', :token =>...

Can you only send out email from the username specified in the ActionMailer smtp_settings?

Hello, in my ActionMailer config file I have this: ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.smtp_settings = { :address => "mail.foo.com", :port => 25, :domain => "foo.com", :authentication => :email, :user_name => "[email protected]", :password => "foo1234567" } With this configuration can I only send o...

how to attach files that are stored in the database to the action mailer?

Hi, you have mention about how to store files in database. How to attach those files with mail using action mailer? I have search many sites but not able to find the way to attach database files. Everywhere the help of attaching files stored in file system is given. ...

Should raise_delivery_errors be set to true in a production Rails app?

The default in Ruby on Rails is to have this set to false (in production and development). config.action_mailer.raise_delivery_errors = false Seems strange. I'm definitely turning it on in development which has been helpful. But why does no one seem to have this turned on in production? Shouldn't we want to get notified if an email...

Rails ActionMailer - format sender and recipient name/email address

Hi, Is there a way to specify email AND name for sender and recipient info when using ActionMailer? Typically you'd do: @recipients = "#{user.email}" @from = "[email protected]" @subject = "Hi" @content_type = "text/html" But, I want to specify name as well-- MyCompany <[email protected]>, John Doe <john.doe@myco...

Rails ActionMailer with the restful authentication plugin won't deliver mail

Hi, I've been working on a rails app that uses the restful authentication plugin. It requires a new user to activate their account through email verification. This has been working up until a few hours ago, when the application suddenly started to fail on email delivery. Instead I am greeted with the following error message: undefin...

Fetching emails in rails via IMAP

I have this rails app that's running on our local intranet, with a thousand regular users. I am looking to integrate it with our email server(MS Exchange). Basically - 1) For each user, the app should fetch any new messages in their inbox from the mail-server, parse it, and file it in the database. I could implement it with ruby/net-im...

Problem sending multipart mail using ActionMailer

Hello, 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...

Problems with ActionMailer: 501 <>: missing or malformed local part

I'm having trouble sending mail using SMTP from a Rails app. I have a Mailer class: class Mailer < ActionMailer::Base def newsletter_confirmation(subscription) recipients "[email protected]" # this is set to my email # just for testing purposes and will ...

Best Practices for receiving email in rails

Hey Everyone, I've been trying to figure out the best way to handle incoming email in a rails applications. I realize "best practices" is quite subjective, so I'll start by stating that my primary concerns are scalability and efficiency. This is an issue primarily because my use will involve handling potentially large attachments. Se...

E-mail Templates in Ruby on Rails

I need help with e-mail templates. I have an html template with three embedded images in it. I am using the restful authentication plugin and have tried to customize the default mailer. The template works great as a standalone webpage but for some reason is not rendering properly with the images. I can either get the images to attach...

ActionMailer get messageid for sent messages

I am writing a rails application that sends emails when certain actions occur, users can then reply to these emails and the system needs to match the reply email to the original email sent to the user. It seems like the best way to do this is to save the message id header field when sending messages, is this possible in ActionMailer? I ...

reuse action mailer template

How do I reuse the same action mailer template for multiple mailer "actions"? In ActionController, you can do ... render :action => 'another_action' I'd imagine the same thing can be done in ActionMailer, but I couldn't seem to find the right method. If it's relevant, I'm on Rails 2.3.2. Thanks! ...