Hi Sri,
Thank you so much for the reply. Really appreciate it.
I had thought this might be related to the Firewall. However, I connected
to VPN and then tried executing the same program. It still ended in error.
Few pointers that I would like to bring to your notice.
a) The Ping to my mail.o365.<company>.com (This is my outlook server)
doesn't work. But I am able to open my emails via http using the same.
b) I tried to use imaplib.IMAP_SSL.open method and found the below error -
Traceback (most recent call last):
File "C:\Sreekul\Python\Dev\sree.py", line 3, in <module>
mail.open()
File "C:\Python27\lib\imaplib.py", line 1177, in open
self.sock = socket.create_connection((host, port))
File "C:\Python27\lib\socket.py", line 575, in create_connection
raise err
error: [Errno 10061] No connection could be made because the target machine
actively refused it
The Outlook 365 server IMAP port is 993.
I will try to implement the library you gave, but could you please shed
some light about what is happening here.
Thank you again.
Regards,
Sreekul Nair
Regards
Sreekul Nair
On Thu, Mar 9, 2017 at 4:05 PM, Sri Kavi <[email protected]> wrote:
> Must be firewall that’s causing the problem?
>
>
>
> Here’s a third-party IMAP client library called IMAPClient which is easier
> to use . You may want to take a look at it.
>
>
> http://imapclient.readthedocs.io/en/stable/
>
>
> Sri
>
> On Thu, Mar 9, 2017 at 11:35 AM, Sreekul Nair <[email protected]>
> wrote:
>
>> Dear All,
>>
>> I have tried to search for related issues in StackOverflow and other
>> python
>> forums but to no avail. And I am really growing desperate to resolve this
>> issue. I am not sure who would be able to help me if not you guys. Its an
>> earnest request to please help me understand what I am doing wrong.
>>
>> Below is the Python code that I have written to simply log into my Outlook
>> 365 server.
>>
>> import imaplib
>> mail = imaplib.IMAP4_SSL('mail.o365.mailserver.com')
>> print mail.login('[email protected]', 'MyPassword')
>> print('Logged in')
>>
>> Running this simple program ends in following error -
>> File "C:\Python27\lib\imaplib.py", line 520, in login
>> raise self.error(dat[-1]) error: LOGIN failed.
>>
>> I have used Python 2.7.12 & 3.6 but to no avail.
>>
>> Request help on this issue.
>>
>> Thanks & regards,
>> Sreekul Nair
>> _______________________________________________
>> Tutor maillist - [email protected]
>> To unsubscribe or change subscription options:
>> https://mail.python.org/mailman/listinfo/tutor
>>
>
>
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor