ActionMailer and Gmail


#1

Has anyone successfully sent a mail from AM through google’s smtp?
in environment.rb I have:

Include your app’s configuration here:

ActionMailer::Base.server_settings = {
:address => “smtp.gmail.com http://smtp.gmail.com”,
:port => 587,
:domain => ‘www.mydomain.com http://www.mydomain.com’,
:user_name => “removed_email_address@domain.invalid”,
:password => “password”,
:authentication => :login
}
I ask because I don’t have access to a mail server, have a gmail
account
though and want to try out action mailer.


#2

Why is your :user_name formatted with HTML?

  • james

#3

Hi,

Try this. Install a mail server on your machine.

on my winxp based machine i installed the following mail server:

http://www.youngzsoft.net/cmailserver/email-server-download.htm

create an account : removed_email_address@domain.invalid with secret password

then use following settings

:smpt

&&&& [see ur cmail server tools -> configuration]

address - localhost
port - 25
domain - yourdomain.com
authenticate - login
user_name - test
password - secret

This works. Hope this helps.


#4

andremedeiros wrote:

AFAIK, you can’t use GMail’s SMTP with AM, because it communicates
through the SSL layer (see GMail’s help on how to setup thunderbird, for
instance).

yeah, André Medeiros is right… gmail’s smtp server only accepts TLS
connections…

let’s extend AM to make this happen?

any rails guru around to help on this? :slight_smile: hehe


#5

Why not setup a local MTA to talk to GMail for you?

My little brother wrote a howto if you’re on *NIX:

http://typo.submonkey.net/articles/2005/09/09/use-gmail-as-a-smart-host

On 23/11/05, André Camargo removed_email_address@domain.invalid wrote:

any rails guru around to help on this? :slight_smile: hehe


Posted via http://www.ruby-forum.com/.


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


Rasputin :: Jack of All Trades - Master of Nuns
http://number9.hellooperator.net/


#6

Deepak S. wrote:

then use following settings

:smpt

&&&& [see ur cmail server tools -> configuration]

address - localhost
port - 25
domain - yourdomain.com
authenticate - login
user_name - test
password - secret

This works. Hope this helps.

I did this and added the following to my environment.rb file, inside
the Rails::Initializer.run do |config| block:

#Mail Server Settings
config.action_mailer.server_settings = {:address => ‘localhost’,
:port => 25,
:domain => ‘mydomain.com’,
:user_name => ‘user’,
:password => ‘password’,
:authentication => ‘plain’}

Would you expect this to work?

Does this section need to be set up with
ActionMailer::Base.server_settings = {…}?

My development log seems to think that the mail is being sent but it
isn’t going through.

Thanks,
Wes


#7

AFAIK, you can’t use GMail’s SMTP with AM, because it communicates
through the SSL layer (see GMail’s help on how to setup thunderbird, for
instance).


#8

Interesting, please let me know if this works for you. For me I
haven’t had such luck, I’m using Google Domain Apps for my domain. At
the moment I just have Rails talk to the local postfix install which
then simply smartrelay’s over SSL to smtp.gmail.com. There seems to
be issues configuring it from within the rails app due to gmail’s
security requirements for logins? Though I’d love to get this working
straight from my rails app.

On Jan 29, 7:07 am, Wes G. removed_email_address@domain.invalid


#9

Hey mate,

If your development is on a mac, go to your terminal and run mail. If
mail isnt getting sent out it will tell you why in there.

Cheers,
Carl.

On 1/29/07, removed_email_address@domain.invalid removed_email_address@domain.invalid wrote:

wrote:

authenticate - login
:user_name => ‘user’,

Thanks,
Wes


Posted viahttp://www.ruby-forum.com/.


Carl W.
0412218979
removed_email_address@domain.invalid