1

In my rails application (running on a mac), I'm using a gem called pony. When I create a message through pony I get the following output (out of a rails console).

#<Mail::Message:2186559360, Multipart: false, Headers: <Date: Tue, 13 Dec 2011 00:15:14 -0500>, <From: you@me.com>, <To: myself@hotmail.com>, <Message-ID: <4ee6df6288e90_30b080443b3c8148e@My-Name-MacBook-Pro.local.mail>>, <Subject: nothing>, <Mime-Version: 1.0>, <Content-Type: text/plain>, <Content-Transfer-Encoding: 7bit>>

This message sends without problem.

For a separate application, running on Ubuntu, pony throws me errors.

I didn't post the errors, because I switched to a gem called mail which gives the same output after sending a message (no errors, the console says it sent fine). But the problem is that no message get sent on the Ubuntu system.

I suspect it's because I've never set up a mailing system on the Ubuntu system (if that's an action that ever needs to be done in the programming world). If it is, I'm not sure how I should do this, so that my mail will get sent.

I'm using rails 3 and Ubuntu Oneiric Ocelot.

Benoit Garret
  • 14,027
  • 4
  • 59
  • 64
jack
  • 454
  • 2
  • 8
  • 22
  • Are there errors, warnings, or informational messages in `/var/log/mail.err`, `/var/log/mail.warn`, `/var/log/mail.info` or `/var/log/mail.log`? – sarnold Dec 14 '11 at 01:39
  • check spam messages in your inbox and make sure the message is indeed sent – djd Dec 14 '11 at 08:24

2 Answers2

1

Instead of relying on the operating system to have a working local sendmail (which OS X does, but I guess your Ubuntu doesn't), you could use an external SMTP server.

For testing and development, your Gmail will work:

Pony.mail(:to => 'you@example.com', :via => :smtp, :via_options => {
  :address              => 'smtp.gmail.com',
  :port                 => '587',
  :enable_starttls_auto => true,
  :user_name            => 'user',
  :password             => 'password',
  :authentication       => :plain, # :plain, :login, :cram_md5, no auth by default
  :domain               => "localhost.localdomain" # the HELO domain provided by the client to the server
})

If you're sending emails from a production app, you could use an inexpensive external SMTP server from http://sendgrid.com/.

Seamus Abshere
  • 8,326
  • 4
  • 44
  • 61
0

Go to ubuntu software center. Search for

mail agent

(what you need is a mail transfer agent)

now something called 'mutt' should be there. Install it. (it worked for me when i had this problem)

Kevin
  • 1,574
  • 4
  • 19
  • 45