5

I tried to connect to Gmail successfully using (after allowing Less secure app access in Gmail):

server=MailServerConnect[
    "imap.gmail.com",
    MailSettings-><|
        "Username"->"xxx@gmail.com",
        "Password"->"xxx",
        "PortNumber"->Automatic
    |>
]

And have been able to manage it from Mathematica but can't get it to connect to my Hotmail account.

server=MailServerConnect[
    "imap.xxx.com",
    MailSettings-><|
        "Username"->"xxx@hotmail.com",
        "Password"->"xxx",
        "PortNumber"->Automatic
    |>
]

Does anyone know the server URL to use for connecting to Hotmail and any additional steps?


Ok, I looked into my account and got the following settings:

POP setting: Server name: outlook.office365.com Port: 995 Encryption method: TLS

IMAP setting: Server name: outlook.office365.com Port: 993 Encryption method: TLS

SMTP setting: Server name: smtp.office365.com Port: 587 Encryption method: STARTTLS

So I updated my commands and got a failed still:

server=MailServerConnect[
    "outlook.office365.com",
    MailSettings-><|
        "Username"->"xxx@hotmail.com",
        "Password"->"xxx",
        "PortNumber"->993,
        "EncryptionProtocol"->"TLS"
    |>
];
folder=server["Inbox"];
item=folder[-1]

$Failed

What am I doing wrong?


Tried and logged in successfully via Outlook desktop application using the following settings:

IMAP setting: Server name: outlook.office365.com Port: 143 Encryption method: TLS

So tried to replicate these settings in Mathematica and got the following error message:

server=MailServerConnect[
    "outlook.office365.com",
    MailSettings-><|
        "Username"->"xxx@hotmail.com",
        "Password"->"xxx",
        "PortNumber"->143,
        "EncryptionProtocol"->"TLS"
    |>
]

MailServerConnect::auth: schannel: next InitializeSecurityContext failed: SEC_E_INVALID_TOKEN (0x80090308) - The token supplied to the function is invalid

$Failed

user13892
  • 9,375
  • 1
  • 13
  • 41

0 Answers0