Hi,

I use something like the task snippet below to send with Ruby's
net/smtp library.  Has the advantage of probably working okay in
Windows as well.  Of course if you have strict SMTP servers this won't
work that well.


task :send_notice do
  # Require libraries to send email properly
  require 'net/smtp'

  # Variables that can be changed
  smtp_server = 'smtp.example.com'
  from_addr = "[EMAIL PROTECTED]"
  to_addr = "[EMAIL PROTECTED]"

msgstr = <<-END_OF_MESSAGE
From: Capistrano Deployment Agency <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: Capistrano deployment notice
Date: #{now.strftime("%a, %d %b %Y %X +0000")}
Message-Id: <#{now.strftime("%m%d%Y%H%M%S")[EMAIL PROTECTED]>

I have deployed a new revision at #{Time.now}

END_OF_MESSAGE

  # Send message
  Net::SMTP.start(smtp_server, smtp_port) do |smtp|
    smtp.send_message(msgstr, from_addr, to_addr)
  end
end

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to