Sending email

I am on ubuntu machine. i want to just do simple testing of sending
emails.

i first tried postfix, then mailtrap (http://rubypond.com/articles/
2007/11/16/trap-rails-from-sending-mail-via-smtp/) to no avail. i keep
getting timed out error.

for postfix my settings were:

config.action_mailer.smtp_settings = {

:address => ‘localhost’,

:port => 25,

:domain => ‘www.example.com

}

i tried changing to port 2525 to use mailtrap and got the same error.
is there something essential i am missing?

i just want to be able to send emails to test funcinality. not receive
and nothing else. i searched around but i can not

sorry message got truncated.

i have looked around but find no solutions…

Hi there,

Setting that has always worked for me without fail is:

config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp

config.action_mailer.smtp_settings = {
:address => “mail.yourdomain.com”,
:port => 25,
:domain => “yourdomain.com
}

HTH,
Schalk

if i dont own a domain and am just interested in sending emails from
dev environment on my laptop would the config look like this:

config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp

config.action_mailer.smtp_settings = {
:address => “localhost”,
:port => 25
}

I reckon as long as you have a SMTP server running on your local machine
at port 25 you should be good to go.

Do I need to uninstall sendmail before trying to use postfix? (sorry
not exactly a rails question)

tashfeen.ekram wrote:

Do I need to uninstall sendmail before trying to use postfix? (sorry
not exactly a rails question)

No. But you do need to determine which one is running and what ip-addr
and port it is listening on. Sendmail listens on 127.0.0.1:25 by default
so that is where the smtp config should point to. I have no experience
with Postfix but I imagine that it is similar. In either case, port 25
is the wks port for smtp traffic.

tashfeen.ekram wrote:

Do I need to uninstall sendmail before trying to use postfix? (sorry
not exactly a rails question)

If setting up an SMTP server on your laptop is too much trouble, you
could always point Rails to your ISP’s SMTP server. This is what I
generally do, at least for development.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Most time what’s wrong is the smtp server.
You should check the smtp server in your machine. If it works well
when you use other client-email application to connect it, please
check the email settings.
And then, you can set the settings to other server.
Such as gmail.
For gmail, you should know the tls.
Good luck.

i just tried to configure to use gmail with the tlsmail gem. i seem to
be getting the same time out error. is there something wrong in my
config. i have tried configuring it to several different inclugin
sendmail and postifx on my laptop, i installed mailtrap plugin, and
now gmail and all give me the same error. really strange…

config for gmail:

require ‘tlsmail’

Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)

ActionMailer::Base.raise_delivery_errors = true

ActionMailer::Base.perform_deliveries = true

ActionMailer::Base.delivery_method = :smtp

ActionMailer::Base.smtp_settings = {

:address => 'smtp.gmail.com',

:port => 587,

:tls => true,

:domain => 'xxxx.com',

:authentication => :plain,

:user_name => 'xxxx',

:password => 'xxxx'

}

On Apr 17, 9:19 am, Marnen Laibow-Koser <rails-mailing-l…@andreas-

what version rails?

what’s the error message?

I use the following under Rails 2.3.2 - no additional gem.
In the file config/initializers/action_mailer.rb:


ActionMailer::Base.delivery_method = :smtp

ActionMailer::Base.smtp_settings = {
:enable_starttls_auto => true,
:address => “smtp.gmail.com”,
:port => “587”,
:domain => “engine.local”,
:authentication => :plain,
:user_name => “bultaco.rick”,
:password => “**********”
}

This works fine for development / testing

require ‘smtp_tls’
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => “smtp.gmail.com”,
:port => “587”,
:domain => “domain.com”,
:authentication => :plain,
:user_name => “[email protected]”,
:password => “password”
}

That is my environment.rb configuration to work with an account with
gmail.

I have my domain to use gmail as the mail service and i don’t use the
line:
Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)


  Agustin Viñao

www.agustinvinao.com
agustinvinao (Skype)