E
Eilie
Hello, how can i recieve email at runtime without reconnecting to IMAP
server?
Here my code:
@imap = Net::IMAP.new(config[:host], config[
ort], config[:ssl])
@imap.login(config[:username], config[
assword])
@imap.select('inbox')
def get_mail
result = {body: []}
@imap.search(["NOT","SEEN","SUBJECT", "test"]).each do |id|
result[:body] << @imap.fetch(id,
'BODY[TEXT]')[0].attr['BODY[TEXT]']
end
result
end
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.
server?
Here my code:
@imap = Net::IMAP.new(config[:host], config[
@imap.login(config[:username], config[
@imap.select('inbox')
def get_mail
result = {body: []}
@imap.search(["NOT","SEEN","SUBJECT", "test"]).each do |id|
result[:body] << @imap.fetch(id,
'BODY[TEXT]')[0].attr['BODY[TEXT]']
end
result
end
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.