2

I am trying to access mail of outlook using mailman But I am getting an error.
getaddrinfo: Name or service not known
I was able to do of gmail with the code but when i tried for outlook it is giving me error.
[outlook_controller]

require "rubygems"
require "bundler/setup"
require "mailman"

class OutlooksController < ApplicationController
    def index
        Mailman.config.poll_interval = 5  # change this number as per your needs. Default is 60 seconds
    Mailman.config.pop3 = {
  server: 'pop.outlook.com', port: 995, ssl: true,
  username: "user-name",
  password: "pass"
}
  Mailman::Application.run do
  default do
    begin
    p "Found a new message"
    p message.from.first # message.from is an array
    p message.to.first # message.to is an array again..
    p message.subject
    rescue Exception => e
      Mailman.logger.error "Exception occurred while receiving message:n#{message}"
      Mailman.logger.error [e, *e.backtrace].join("n")
    end
  end
end
Aniket Tiwari
  • 3,561
  • 4
  • 21
  • 61
  • The code here does not produce the same error on my box as you report here. Instead of "Name or service not known," the error I get is "Logon failure: unknown user name or bad password." What happens when you try this command from a command prompt?: `ping pop.outlook.com` – Wayne Conrad Jan 18 '16 at 12:03
  • When I am trying to ping I am getting no response ... – Aniket Tiwari Jan 19 '16 at 04:21
  • You have a network problem, not a code problem. `pop.outlook.com` is pingable for me. – Wayne Conrad Jan 19 '16 at 12:16
  • I have tried from other places .I am able to ping but still I am getting error .do u know any other address other than pop.outlook.com – Aniket Tiwari Jan 22 '16 at 05:24

0 Answers0