Forum: Ruby on Rails Getting Rails to send email

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.
0bfcd61fc289de2e441929ecfd00b0ed?d=identicon&s=25 Peter Hickman (Guest)
on 2009-03-21 12:39
(Received via mailing list)
I have a site that I want to send out emails for when people forget
their password. I've read the various articles on how to get Rails to
send emails but what I need is how to set up the software to allow
emails to be sent at all. I once say an article that covered setting
up exim / postfix but can't find it anymore. Does anyone know what
packages I need to install and how I might configure them or some
pointers to where I can find this out?

I am running debian 4.0

Thanks
6b46f4eed76df33a3ffacf87bc9f1079?d=identicon&s=25 vimal (Guest)
on 2009-03-21 12:53
(Received via mailing list)
Hi Hickman,

Check out the documentation in
http://guides.rails.info/action_mailer_basics.html
this is the default module for Rails.


I am using ruport(Ruby reports) to send email

gem install ruport
gem install ruport-util

>> require 'rubygems'
>> require 'ruport'
>> require 'ruport/util'

>> r = Ruport::Report.new
>> r.add_mailer :default, :host => "localhost", :address => "xxx@xxx.com"
>> r.send_to(email_id) do |mail|
>>    mail.subject = "Some subject"
>>    mail.text = "Some text"
>>    mail.html = "<h1>Hello World</h1>"
>> end

For further info. check ruport documentation

Regards,
Vimal Das
0bfcd61fc289de2e441929ecfd00b0ed?d=identicon&s=25 Peter Hickman (Guest)
on 2009-03-21 17:13
(Received via mailing list)
No quite what I was looking for. I have seen plenty of documentation
as to how to send mail from Ruby but they all assume that you have an
MTA like sendmail, postfix or exim4 already set up. The machine that I
have has neither installed or, obviously, configured.

I was thinking that this is the sort of problem that others must have
encountered before and perhaps they could shed some light on what I
should be looking for.

Thanks anyway
Dd2d775dea75b381edb1bbf0600a0907?d=identicon&s=25 Marnen Laibow-Koser (marnen)
on 2009-03-21 18:59
Peter Hickman wrote:
> No quite what I was looking for. I have seen plenty of documentation
> as to how to send mail from Ruby but they all assume that you have an
> MTA like sendmail, postfix or exim4 already set up.
[...]

To avoid the hassle of setting up Postfix or similar, I just give
ActionMailer the connection info for my ISP's SMTP server.  That should
do the trick.

Best,
--
Marnen Laibow-Koser
marnen@marnen.org
http://www.marnen.org
59528506e6297141161afcde91d677c9?d=identicon&s=25 Nicolai Reuschling (codeblogger)
on 2009-03-22 01:10
(Received via mailing list)
2009/3/21 Peter Hickman <peterhi@ntlworld.com>

>
> No quite what I was looking for. I have seen plenty of documentation
> as to how to send mail from Ruby but they all assume that you have an
> MTA like sendmail, postfix or exim4 already set up. The machine that I
> have has neither installed or, obviously, configured.
>

Hi Peter,

answering this question is out of the scope of this mailing list. You
will
find plenty of mail server installation guides via your favorite search
enginee - or you can you existing mail accounts (see guides.rails.info).

Regards
Nicolai
F999a7c806afd4b1d53f9fed9a18c704?d=identicon&s=25 Jason Arora (Guest)
on 2009-03-22 01:37
(Received via mailing list)
Hey Peter,

Nicolai is correct, this isn't really the right place for this kind of
question. However, because I have recently setup a Postfix mail agent
on Slicehost, I might be able to help you. Their documentation is
actually really good. Additionally, if you just need outgoing mail
(like sending emails to admin), then you probably won't even have to
configure ActionMailer (the default settings should work).

Check out the docs and if you are still having trouble, shoot me an
email.
http://articles.slicehost.com/2008/7/29/postfix-installation

HTH,
Jason Arora
This topic is locked and can not be replied to.