Forum: Ruby on Rails Unable to set the replay-to in ActionMailer

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
059ed46172a087063ce26250e44c8627?d=identicon&s=25 Fernando Perez (fernando)
on 2009-02-23 23:49
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,
D69d23d8e811e8ab2a8593380d6ede63?d=identicon&s=25 Jeff Emminger (jemminger)
on 2009-02-24 17:01
(Received via mailing list)
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       "system@example.com"
     reply_to  "other@example.com"
     subject    "New account information"
     body       :account => recipient
   end
 end




On Feb 23, 5:49 pm, Fernando Perez <rails-mailing-l...@andreas-s.net>
059ed46172a087063ce26250e44c8627?d=identicon&s=25 Fernando Perez (fernando)
on 2009-02-24 17:26
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.
D69d23d8e811e8ab2a8593380d6ede63?d=identicon&s=25 Jeff Emminger (jemminger)
on 2009-02-24 18:35
(Received via mailing list)
Ah - what smtp server are you using


On Feb 24, 11:26 am, Fernando Perez <rails-mailing-l...@andreas-s.net>
059ed46172a087063ce26250e44c8627?d=identicon&s=25 Fernando Perez (fernando)
on 2009-02-24 22:01
Jeff Emminger wrote:
> Ah - what smtp server are you using
>
>
> On Feb 24, 11:26�am, Fernando Perez <rails-mailing-l...@andreas-s.net>

I use Citadel (www.citadel.org).
D69d23d8e811e8ab2a8593380d6ede63?d=identicon&s=25 Jeff Emminger (jemminger)
on 2009-02-25 03:45
(Received via mailing list)
> I use Citadel (www.citadel.org).
> --

I would check with them to see why they are overwriting the Reply-to
header.
059ed46172a087063ce26250e44c8627?d=identicon&s=25 Fernando Perez (fernando)
on 2009-03-03 00:39
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.
This topic is locked and can not be replied to.