Forum: Ruby on Rails Problems setting gmail mail

432651f04bb75f626b2b049fefec0827?d=identicon&s=25 Remi B. (remi_b)
on 2012-10-08 12:41
Attachment: errnoECONNREFUSED.jpg (300 KB)
Hello,

as attachment my problems concerning gmail Mailer errors in Rails. I
hope anyone can help me out with the problem?

If there is extra information needed, please tell me what you need more
to help me out of my problems!


Greetings!
432651f04bb75f626b2b049fefec0827?d=identicon&s=25 Remi B. (remi_b)
on 2012-10-08 19:44
If there is any extra information required, please notify me.
I am looking for this problem for several hours. I have been watching
hundreds of websites not finding what the problem is.

I really don't know what the problem is now...

Am I doing something wrong in my code? This keeps me from my work in the
current project I am working on...


Greetings!
5f94b9b346c2aa648a80bc259978e5bc?d=identicon&s=25 Colin Law (Guest)
on 2012-10-08 21:20
(Received via mailing list)
On 8 October 2012 11:41, Remi B. <lists@ruby-forum.com> wrote:
> Hello,
>
> as attachment my problems concerning gmail Mailer errors in Rails. I
> hope anyone can help me out with the problem?
>
> If there is extra information needed, please tell me what you need more
> to help me out of my problems!

I, for one, cannot read the text in the image.  Please copy/paste the
relevant error and code here.

Colin
432651f04bb75f626b2b049fefec0827?d=identicon&s=25 Remi B. (remi_b)
on 2012-10-08 22:22
So here is the error I get:

********ERROR WHEN CREATING NEW USER*************

Errno::ECONNREFUSED in UsersController#create

app/controllers/users_controller.rb:47:in `block in create'
app/controllers/users_controller.rb:45:in `create'

**********UsersController#create*****************

def create
    @user = User.new(params[:user])

    respond_to do |format| <--- LINE 45 --->
      if @user.save
        UserMailer.send_email(@user).deliver <--- LINE 47 -->
        format.html { redirect_to @user, notice: 'User was successfully
created.' }
        format.json { render json: @user, status: :created, location:
@user }
      else
        format.html { render action: "new" }
        format.json { render json: @user.errors, status:
:unprocessable_entity }
      end
    end
  end

*****************UserMailer**********************

class UserMailer < ActionMailer::Base
  default from: "myaddress@gmail.com"

  def send_email(user)
    @user = user
    mail(:to => "#{user.name} <#{user.email}>", :subject =>
"Registered")
  end
end

*******Config/Environments/development.rb*********

# Don't care if the mailer can't send
  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.perform_deliveries = true

  config.action_mailer.smtp_settings = {
      :enable_starttls_auto => true,
      :address        => 'smtp.gmail.com',
      :port           => 587,
      :domain         => 'localhost:3000',
      :authentication => :login,
      :content_type   => "text/html",
      :user_name      => 'myemail@gmail.com',
      :password       => 'mypassword'
  }


I hope I gave enough information!
If needed, please ask for more
5f94b9b346c2aa648a80bc259978e5bc?d=identicon&s=25 Colin Law (Guest)
on 2012-10-08 22:39
(Received via mailing list)
On 8 October 2012 21:22, Remi B. <lists@ruby-forum.com> wrote:
>
>       else
>   default from: "myaddress@gmail.com"
> # Don't care if the mailer can't send
>       :content_type   => "text/html",
>       :user_name      => 'myemail@gmail.com',
>       :password       => 'mypassword'
>   }

I have not done this myself but [1] suggests the authentication should
be :plain.  There are other detail differences also.

Colin

[1]
http://guides.rubyonrails.org/action_mailer_basics...
432651f04bb75f626b2b049fefec0827?d=identicon&s=25 Remi B. (remi_b)
on 2012-10-08 22:49
Unfortunately,

I've copy/pasted the guides of rubyonrails itself already 3 or 4 times
to make sure there aren't any differences.
I change a couple of things to look if that isn't the problem. I've
(once again) tried the copy/paste and change to my settings.
The only thing I changed now is that I left away the :domain and the
:content_type. Toghether with a "plain" string, in stead of a :login

Could it be a firewall related problem?

In any case, thanks for the help ;)


Friendly regards
432651f04bb75f626b2b049fefec0827?d=identicon&s=25 Remi B. (remi_b)
on 2012-10-08 23:09
Remi B. wrote in post #1079017:
> Unfortunately,
>
> I've copy/pasted the guides of rubyonrails itself already 3 or 4 times
> to make sure there aren't any differences.
> I change a couple of things to look if that isn't the problem. I've
> (once again) tried the copy/paste and change to my settings.
> The only thing I changed now is that I left away the :domain and the
> :content_type. Toghether with a "plain" string, in stead of a :login
>
> Could it be a firewall related problem?
>
> In any case, thanks for the help ;)
>
>
> Friendly regards

I don't know how it comes that I related the firewall with it, but I
sure found the problem:

My mcafee was blocking my ruby.exe file, it said this in my
accessprotectionlog:

10/8/2012  10:48:11 PM  Blocked by port blocking rule
c:\Ruby193\bin\ruby.exe  Anti-virus Standard Protection:Prevent mass
mailing worms from sending mail

So for all those who have this problem, look at your firewall or virus
scan!

I went to the exceptions and added ruby.exe to this list!

Hope I will help some other unfortunate too!
Aad37b5f7116c8d1f547d23b37566032?d=identicon&s=25 Greg Donald (destiney)
on 2012-10-09 05:25
(Received via mailing list)
On Mon, Oct 8, 2012 at 4:09 PM, Remi B. <lists@ruby-forum.com> wrote:
> So for all those who have this problem, look at your firewall or virus
> scan!

Or use an OS that doesn't require participation in the Microsoft virus
protection racket.

A firewall that runs any software except packet filtering isn't a
firewall, it's a false sense of security.


--
Greg Donald
52f3528c40e9cf28ad0900886eecb128?d=identicon&s=25 Jordon Bedwell (Guest)
on 2012-10-09 05:33
(Received via mailing list)
I'm no Windows fan but....

On Mon, Oct 8, 2012 at 10:23 PM, Greg Donald <gdonald@gmail.com> wrote:
> Or use an OS that doesn't require participation in the Microsoft virus
> protection racket.

Because Mac's don't have Malware protection, oh wait, Apple just
doesn't tell you that they have internal Malware protection and you
obviously missed the memo on other operating systems getting Malware
too but it's fine, not all of us know how to read and not spew FUD.

> A firewall that runs any software except packet filtering isn't a
> firewall, it's a false sense of security.

Because Windows firewall doesn't support packet filtering... Because
you can't get another firewall?  I mean, it's so hard to find another
software Firewall that companies like ESET decided to no longer offer
them because... wel...l I mean you can't disable Windows firewall and
use theirs... Right?



Take your jokes somewhere else, you're not good at comedy.
Aad37b5f7116c8d1f547d23b37566032?d=identicon&s=25 Greg Donald (destiney)
on 2012-10-09 06:26
(Received via mailing list)
On Mon, Oct 8, 2012 at 10:32 PM, Jordon Bedwell <envygeeks@gmail.com>
wrote:
> Because Mac's don't have Malware protection, oh wait, Apple just
> doesn't tell you that they have internal Malware protection and you
> obviously missed the memo on other operating systems getting Malware
> too but it's fine, not all of us know how to read and not spew FUD.

I never said anything about a Mac, but since you brought it up.. is
that what you Dreamweaver programmers use these days?

> Because Windows firewall doesn't support packet filtering... Because
> you can't get another firewall?  I mean, it's so hard to find another
> software Firewall that companies like ESET decided to no longer offer
> them because... wel...l I mean you can't disable Windows firewall and
> use theirs... Right?

Sorry dude.. you have me at a disadvantage.  I don't know much at all
about Windows except that it has something like 98343203993 entries on
Metasploit.  Seems more than enough reason to stay away.

> Take your jokes somewhere else, you're not good at comedy.

I wasn't trying to be funny.

It's a choice to either participate in the virus protection racket, or
not.

It's a choice to do dumb shit like run firewall software on your
desktop OS, or not.

A firewall is a packet filter, that's it, nothing more.  If it's
preventing something like Ruby from even starting up, it's no longer a
firewall, it's something else.  So then call it something else.  I
recommend "thing that is using all my spare ram and cpu 'cause I'm too
busy drinking the M$ koolaid to notice".

Again, not trying to be funny at all.


--
Greg Donald
52f3528c40e9cf28ad0900886eecb128?d=identicon&s=25 Jordon Bedwell (Guest)
on 2012-10-09 07:03
(Received via mailing list)
On Mon, Oct 8, 2012 at 11:25 PM, Greg Donald <gdonald@gmail.com> wrote:
> I never said anything about a Mac, but since you brought it up.. is
> that what you Dreamweaver programmers use these days?

Yup, because clearly Dreamweaver is available on Linux in a native
form.  But a fail troll is fail, keep trying harder maybe one day
you'll get more clever in your trolls.

> Sorry dude.. you have me at a disadvantage.  I don't know much at all
> about Windows except that it has something like 98343203993 entries on
> Metasploit.  Seems more than enough reason to stay away.

So does Flash and Firefox (though I will not spew a random number that
makes it seem like it's the worst thing in the world,) but people
still use them, everything has an exploit sometime, the difference
between good and bad is fixing it or leaving it open.  I guess Linux
has never had an exploit, Mac has never had one, nobody but Windows
has ever had one.

> I wasn't trying to be funny. It's a choice to either participate in the virus
protection racket, or not.

You're right, it is a choice to choose to be a target or not. On that
subject, do you like to run into the middle of a gun range too and see
if you get hit with a bullet or not? If you don't then will you
automatically label all guns as inaccurate and therefore worthless at
doing their principle job?

> A firewall is a packet filter, that's it, nothing more.  If it's
> preventing something like Ruby from even starting up, it's no longer a
> firewall, it's something else.  So then call it something else.  I
> recommend "thing that is using all my spare ram and cpu 'cause I'm too
> busy drinking the M$ koolaid to notice".

Nice joke.  Keep trying though.

> Again, not trying to be funny at all.

Still coming off as a guy who is trying to be the next big comedian.
Dully note this is my last reply, I'm not in this to steal this guys
thread and it's already bad enough I've replied twice, so I'm done
with replying so that I do not cluster a thread with more crap than I
already have.
432651f04bb75f626b2b049fefec0827?d=identicon&s=25 Remi B. (remi_b)
on 2012-10-09 08:46
If you have these restrictions of working with a enterprise virus scan
and you have to work with Windows as it is company policy, I don't know
what discussion there has to be made concerning operating systems.

I didn't want to start any of these discussions, I wanted to state
problems for whoever has the same issue (I don't care if it is a windows
user, mac user, Linux,...) it is just that I want to bring up solutions
for people by stating and solving my own!

I think discussions between OS's can go on for hours, it is just that
every operating system has its pros and its cons... but a lot of users
will be using windows with a virusscan on it that could block the mailer
from sending mails!
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.