Forum: Ruby on Rails e-mail from rails 2.3.10 and ruby 1.8.7

068f24a27636f3ae81d83e2d701a6ecb?d=identicon&s=25 Edu Mariano (Guest)
on 2013-07-29 16:46
(Received via mailing list)
Hi people, im trying to send e-mails using rails 2.3.10 and ruby 1.8.7

I have googled a lot but the best result i got was a code that not sent
the
e-mail and not dropped any error. Some one knows or has an example of a
working e-malier for this version of rails and ruby?

Thanks in advance.
Edu
52f3528c40e9cf28ad0900886eecb128?d=identicon&s=25 Jordon Bedwell (Guest)
on 2013-07-29 16:57
(Received via mailing list)
On Mon, Jul 29, 2013 at 9:44 AM, Edu Mariano <edumariano@bol.com.br>
wrote:
> Hi people, im trying to send e-mails using rails 2.3.10 and ruby 1.8.7

I hurd the best way to send emails on 2.3 was to upgrade to 3.2 or 4.0
and use Ruby 1.9.3+. To help you would be passively accept and reward
using outdated, dead and possibly insecure technologies.  I cannot do
that.
A47e0a6beeb9d048ff054fc1c3a97418?d=identicon&s=25 Walter Davis (walterdavis)
on 2013-07-29 17:02
(Received via mailing list)
At RailsConf this year, there was a vendor selling support for Rails
2.3. For a fairly steep bit of change, they will continue to patch Rails
and Ruby for security, and provide support to developers who use their
patched versions of same. Didn't write it down, since I've moved on, but
there are major developers still using 2.3, on huge mission-critical
applications that rely on it. You're not alone.

Walter
Bdf1f2ad97e7b9c9db1fa70e3cef48bf?d=identicon&s=25 bacrossland (Guest)
on 2013-07-29 18:12
(Received via mailing list)
On Monday, July 29, 2013 9:44:56 AM UTC-5, Edu Mariano wrote:

> Hi people, im trying to send e-mails using rails 2.3.10 and ruby 1.8.7
>
> I have googled a lot but the best result i got was a code that not sent
> the e-mail and not dropped any error. Some one knows or has an example of a
> working e-malier for this version of rails and ruby?
>
> Thanks in advance.
> Edu
>

Hi Edu,

The way ActionMailer worked in 2.3 is quite different from the way it
works
now in 3.2 and 4.*. There are some older apps that you can look at
pre-2.3
that had modles that used ActionMailer built in. ActionMailer did not
change much between 2.1 and 2.3. The links that I will be providing in
this
example is from an app that is 2.1 but, when upgraded, will run under
2.3
with no changes to the model code for ActionMailer. The application is
coded for ruby 1.8.7.

First you would want to setup your Model like by inheriting from
ActionMailer. Then specify as methods each of the mail actions you
wanted
to take.

Model:
https://github.com/insoshi/insoshi/blob/master/app...
Views:
https://github.com/insoshi/insoshi/blob/master/app...

https://github.com/insoshi/insoshi/blob/master/app...

https://github.com/insoshi/insoshi/blob/master/app...

You'll also need to make sure you ActionMailer preferences are setup.
This
app did it by specifying them in an initializer because it pulled
information from a database as to what should be specified for smtp.

Initializer:
https://github.com/insoshi/insoshi/blob/master/con...

Let us know how it goes. If you have any questions I will do my best to
help answer them. Rails 2.3 was awhile ago so I'm a little rusty.

Thanks,
Bryan
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.