Forum: Ruby e-mail

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.
9aa1e92a0ebb17fdaad2fa39b4c52b8a?d=identicon&s=25 misiek (Guest)
on 2006-01-09 21:08
(Received via mailing list)
how to send e-mail with ruby on rails ?
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 Austin Ziegler (Guest)
on 2006-01-09 21:15
(Received via mailing list)
On 09/01/06, misiek <michaelaugustyniak@gazeta.pl> wrote:
> how to send e-mail with ruby on rails ?

Learn more about ActiveMailer here:

 http://lists.rubyonrails.org/mailman/listinfo/rails

-austin
1c46e952a61c99d9eae4f21037a088fd?d=identicon&s=25 Anatol Pomozov (Guest)
on 2006-01-09 21:15
(Received via mailing list)
430ea1cba106cc65b7687d66e9df4f06?d=identicon&s=25 David Vallner (Guest)
on 2006-01-09 21:30
(Received via mailing list)
Speaking of which, by mere coinkydink I needed that article right now
too. Yet my ISPs SMTP server doesn't seem to let me through; does anyone
know what are the common limitations that ISPs enforce on e-mails sent
via their SMTP servers? I'm wondering whether setting my HELO domain to
my webhost's as opposed to something that looks like what the ISP might
have given me could cause a failure in the mail being deliverred.

More generally, is there any way to check on the status of a mail sent
via SMTP?

David Vallner
E7559e558ececa67c40f452483b9ac8c?d=identicon&s=25 unknown (Guest)
on 2006-01-09 22:06
(Received via mailing list)
On Jan 9, 2006, at 3:29 PM, David Vallner wrote:
> Speaking of which, by mere coinkydink I needed that article right
> now too. Yet my ISPs SMTP server doesn't seem to let me through;
> does anyone know what are the common limitations that ISPs enforce
> on e-mails sent via their SMTP servers? I'm wondering whether
> setting my HELO domain to my webhost's as opposed to something that
> looks like what the ISP might have given me could cause a failure
> in the mail being deliverred.


Many ISPs block outbound TCP connections to port 25 (the SMTP port).
They require you to connect to the mail server provided by the ISP,
which will then deliver the mail outside the ISP's network.

Some ISPs have a procedure to lift the outbound port 25 filters for
specific
customers.  You'll have to check with your ISP.

You can thank the spammers for this situation.  It is designed to
provide
a mechanism for auditing outgoing email such that spam sources can be
identified
and shutdown before they cause the ISP to be put on various
blacklists as a source
of spam.   If your address block gets put on such a list it can have
a serious
operational impact (i.e. email to/from your customers stops flowing)
so ISP's
have to be aggressive about identifying and eliminating sources of SPAM.

Gary Wright
430ea1cba106cc65b7687d66e9df4f06?d=identicon&s=25 David Vallner (Guest)
on 2006-01-10 00:29
(Received via mailing list)
gwtmp01@mac.com wrote:

>
>
>
> Many ISPs block outbound TCP connections to port 25 (the SMTP port).
> They require you to connect to the mail server provided by the ISP,
> which will then deliver the mail outside the ISP's network.

Well, my ISP is rather happy with anything I do, I had a problem which
seemed like a server config failure. Turned out silly me was using a
semicolon instead of a comma to separate multiple recipients...

> blacklists as a source
>
Anyways, that problem got resolved, but here's another quirk. My test
method went like:


    class Notify
        def notifier_test(test_message)
            recipients "fred@example.com, barney@example.com,
    wilma@example.com"
            from "betty@example.com"
            subject "Notifier Test"

            body ["test_message" = test_message]
        end
    end

(That's using the traits versions of the code).

And the template was:

    Notifier Test

    Test message: <%= @test_message %>


And when I tried to go Notify.deliver_notifier_test("Testing.") in a
Rails console, I got a very weird Exception / traceback, possibly while
compiling the ERB template:

    ActionView::TemplateError:

    ActionView::TemplateError (`@test_messageTesting.' is not allowed as
    an instance
     variable name) on line #0 of
app/views/notify_tn1/notifier_test.rhtml:
    1: This is a notifier test e-mail.
    2:
    3: The test message is: <%= @test_message %>

    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:333
    :in `instance_variable_set'

    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:333
    :in `assign_variables_from_controller'

    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:333
    :in `assign_variables_from_controller'

    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:323
    :in `evaluate_assigns'

    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:264
    :in `compile_and_render_template'

    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:244
    :in `render_template'

    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:205
    :in `render_file'

    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:226
    :in `render'

    d:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:
    357:in `render'

    d:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:
    352:in `render_message'

    d:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:
    300:in `create!'

    d:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:
    263:in `initialize'
        d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
    `new'

    d:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:
    223:in `method_missing'
        (irb):1:in `irb_binding'
        d:/ruby/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding'
        d:/ruby/lib/ruby/1.8/irb/workspace.rb:52


            from On line #0 of app/views/notify_tn1/notifier_test.rhtml

        1: This is a notifier test e-mail.
        2:
        3: The test message is: <%= @test_message %>

    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:333
    :in `instance_variable_set'

    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:333
    :in `assign_variables_from_controller'

    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:333
    :in `assign_variables_from_controller'

    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:323
    :in `evaluate_assigns'

    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:264
    :in `compile_and_render_template'

    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:244
    :in `render_template'

    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:205
    :in `render_file'

    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:226
    :in `render'

    d:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:
    357:in `render'

    d:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:
    352:in `render_message'

    d:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:
    300:in `create!'

    d:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:
    263:in `initialize'
        d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
    `new'

    d:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:
    223:in `method_missing'
        (irb):1:in `irb_binding'
        d:/ruby/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding'
        d:/ruby/lib/ruby/1.8/irb/workspace.rb:52
    Maybe IRB bug!!
Cff9eed5d8099e4c2d34eae663aae87e?d=identicon&s=25 Jacob Fugal (Guest)
on 2006-01-10 00:56
(Received via mailing list)
On 1/9/06, David Vallner <david@vallner.net> wrote:
>
>     Test message: <%= @test_message %>
>      variable name) on line #0 of app/views/notify_tn1/notifier_test.rhtml:
>     1: This is a notifier test e-mail.
>     2:
>     3: The test message is: <%= @test_message %>

I've not used ActionMailer, so I'm not sure what the syntax should be,
but my guess is the line:

      body ["test_message" = test_message]

Is causing the error. Maybe that should be:

      body ["test_message" => test_message]

???

Jacob Fugal
430ea1cba106cc65b7687d66e9df4f06?d=identicon&s=25 David Vallner (Guest)
on 2006-01-10 01:23
(Received via mailing list)
Jacob Fugal wrote:

>>    wilma@example.com"
>>
>>
>but my guess is the line:
>
>
>
No, that's a typo I made in the e-mail - that wouldn't compile right out
instead of getting as far as the ERB template. I suppose I should
subscribe to the Rails lists for this. (Oh noes, more spam in my
mailbox)

David Vallner
This topic is locked and can not be replied to.