dcparker / ruby-gmail

A Rubyesque interface to Gmail. Connect to Gmail via IMAP and manipulate emails and labels. Send email with your Gmail account via SMTP. Includes full support for parsing and generating MIME messages.
http://dcparker.github.com/ruby-gmail
790 stars 123 forks source link

No way to tell if I'm logged in #80

Open michaelfward opened 9 years ago

michaelfward commented 9 years ago

This code snippet should explain it: require 'gmail'

username = ARGV[0] password = ARGV[1]

gmail = Gmail.new(username, password) puts "success!" if gmail.logged_in? == true

is there no other way to check? I've tried a few different methods, but I get IMAP errors and the script crashes instead of just giving me a "false" back.