IMAP: recieve email at runtime

Discussion in 'Ruby' started by Eilie, Jun 3, 2012.

  1. Eilie

    Eilie Guest

    Hello, how can i recieve email at runtime without reconnecting to IMAP
    Here my code:

    @imap =[:host], config[:port], config[:ssl])
    @imap.login(config[:username], config[:password])'inbox')

    def get_mail
    result = {body: []}["NOT","SEEN","SUBJECT", "test"]).each do |id|
    result[:body] << @imap.fetch(id,

    When i send email to my box and after that i start script with get_mail -
    i get my mail.
    But when o send email with already running script - i get nothing.
    Eilie, Jun 3, 2012
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.