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.
Peter H. (Guest)
on 2009-03-21 13: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
vimal (Guest)
on 2009-03-21 13: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 => 
"removed_email_address@domain.invalid"
>> 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
Peter H. (Guest)
on 2009-03-21 18: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
Marnen L. (Guest)
on 2009-03-21 19:59
Peter H. 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
removed_email_address@domain.invalid
http://www.marnen.org
Nicolai R. (Guest)
on 2009-03-22 02:10
(Received via mailing list)
2009/3/21 Peter H. <removed_email_address@domain.invalid>

>
> 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
Jason Arora (Guest)
on 2009-03-22 02: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.