Unable to set the replay-to in ActionMailer


#1

Hi,

Users can contact me through a form that sends emails through
ActionMailer, the problem is that I can’t set “reply_to”, and the “from”
is actually set to my account on the server which sends the email, so I
have to copy and paste the user email which is saved in the body in the
reply of my mail client and that’s painful.

Has anyone been able to set the reply_to option?

http://api.rubyonrails.com/classes/ActionMailer/Base.html is rather thin
on instructions on how to do that? Or did they skip it on purpose?

I also tried setting: headers ‘reply-to’ => email, ‘Reply-ro’ => email,
but none worked.

Best regards,


#2

That very document states:

reply_to - Takes one or more email addresses. These addresses will be listed as the default recipients when replying to your email. Sets the Reply-To: header.

You should be able to like so:

class Notifier < ActionMailer::Base
def signup_notification(recipient)
recipients recipient.email_address_with_name
from “removed_email_address@domain.invalid”
reply_to “removed_email_address@domain.invalid”
subject “New account information”
body :account => recipient
end
end

On Feb 23, 5:49 pm, Fernando P. removed_email_address@domain.invalid


#3

Jeff Emminger wrote:

That very document states:

reply_to - Takes one or more email addresses. These addresses will be listed as the default recipients when replying to your email. Sets the Reply-To: header.

As I said I can’t make it work, the email address used to connect to my
smtp server constantly over-writes or takes precedence over the reply_to
option. I tried setting the headers too, but still no luck.


#4

Ah - what smtp server are you using

On Feb 24, 11:26 am, Fernando P. removed_email_address@domain.invalid


#5

I use Citadel (www.citadel.org).

I would check with them to see why they are overwriting the Reply-to
header.


#6

Jeff Emminger wrote:

I use Citadel (www.citadel.org).

I would check with them to see why they are overwriting the Reply-to
header.

Thanks for putting me on the correct track, I have been able to solve my
problem. Citadel was not formerly allowing me to set the reply_to and
from headers.


#7

Jeff Emminger wrote:

Ah - what smtp server are you using

On Feb 24, 11:26�am, Fernando P. removed_email_address@domain.invalid

I use Citadel (www.citadel.org).