[Rg 121] [PATCH] contrib/email.rb - EmailHelper

jesuswasramazing.10.pistos at geoshell.com jesuswasramazing.10.pistos at geoshell.com
Thu Jan 10 18:51:04 EST 2008


Here is a helper which will send basic e-mails using net/smtp
(standard with Ruby).  Full usage options are in the source comments,
but basic usage is:

   require 'ramaze/contrib/email'

   EmailHelper.trait[ :smtp_server ] = 'smtp.your-isp.com'
   EmailHelper.trait[ :smtp_helo_domain ] = "originating-server.com"
   EmailHelper.trait[ :smtp_username ] = 'username'
   EmailHelper.trait[ :smtp_password ] = 'password'
   EmailHelper.trait[ :sender_address ] = 'no-reply at your-domain.com'

To send an e-mail:

   EmailHelper.send(
     "foo at foobarmail.com",
     "Your fooness",
     "Hey, you are very fooey!"
   )


Pistos
-- 
http://blog.purepistos.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: email-helper.patch.gz
Type: application/x-gzip
Size: 1584 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/ramaze-general/attachments/20080110/5f665474/attachment.gz 


More information about the Ramaze-general mailing list