Problems setting gmail mail

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!

Attachments: http://www.ruby-forum.com/attachment/7790/errnoECONNREFUSED.jpg

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!

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

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

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

Colin

[1] Action Mailer Basics — Ruby on Rails Guides

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.

Could it be a firewall related problem?

In any case, thanks for the help :wink:

Friendly regards

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 :wink:

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!

Hope I will help some other unfortunate too!

I'm no Windows fan but....

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.

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.

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!