Currently we are using the mail gem to access our email in outlook.
Mail.defaults do
retriever_method :pop3,
address: "outlook.office365.com",
port: 995,
user_name: username,
password: password,
enable_ssl: true'
end
all_mails = Mail.all
According to Microsoft, they no longer support login with user_name and password for POP3 mail anymore, and now require an oauth_token from oauth2. I am able to get the token fine, but not sure if there is away to use that token in the mail gem.
You could try setting it up this way