=begin
Tested with ruby 1.8.7 on a Debian machine, with my own gmail account.
ruby -rubygems "from name" "from email" "to name" "to email" "subject"
"body"
=end
require 'net/smtp'
require 'tlsmail'
Net::SMTP.enable_tls OpenSSL::SSL::VERIFY_NONE
$SERVER = '
smtp.gmail.com'
$PORT = '587'
$DOMAIN = 'loclahost'#HELO domain
$USERNAME = 'username'
$PASSWORD = 'password'
from_name = ARGV[0]
from_email = ARGV[1]
to_name = ARGV[2]
to_email = ARGV[3]
subject = ARGV[4]
body = ARGV[5]
msg = <<EOF
From: #{from_name} <#{from_email}>
To: #{to_name} <#{to_email}>
Subject: #{subject}
#{body}
EOF
Net::SMTP.start( $SERVER, $PORT, $DOMAIN, $USERNAME,
$PASSWORD, :plain ) do |smtp|
smtp.sendmail msg, from_email, to_email
end
I use this to send email. maybe you can tweak it a bit to retrieve
emails.
On Apr 19, 4:59 pm, Vladimir Rybas <
vladimirry...@gmail.com> wrote:
> I've used Fetcher plugin for that. Worked for mehttp://
github.com/look/fetcher
> > > Posted viahttp://
www.ruby-forum.com/.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > "Ruby on Rails: Talk" group.
> > > To post to this group, send email to
rubyonra...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> >
rubyonrails-ta...@googlegroups.com<
rubyonrails-talk%2Bunsu...@googlegroups.com>
> > .
> >
rubyonrails-ta...@googlegroups.com<
rubyonrails-talk%2Bunsu...@googlegroups.com>
> > .
> For more options, visit this group athttp://
groups.google.com/group/rubyonrails-talk?hl=en.