curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: office365 smtp auth issue

From: Stephen Booth via curl-library <>
Date: Thu, 28 Sep 2023 08:32:47 +0100

On 28/09/2023 08:03, Volker Schmid via curl-library wrote:
> Thank you Ray, that was helpful. I just found some small examples
> calling these URLs. But if I let the user open some URL, how do I get
> the result? Webbrowsers usually don't tell me the results of opening a
> URL. I'm confused. Theremust be some API that I have to call for sure.
> Until now, I only have email address, password and smtp mailserver. This
> is provided by the user. The thing is, I should open some URL now. But
> what URL is to be used for the token? Microsoft for sure uses other URLs
> than Google and others. But the mailserver neither tells me the URL nor
> do I get it from somewhere else? The user don't knows it either. Maybe
> it is derived from the domain part of the email address? Is there a
> standard RFC that I can refer to for learning this?

Since January Office365 basically forbids the use of simple password
authentication for most things.

However it looks like there is an exception for SMTP so it must be a
tenant or user setting requiring this in your case rather than a
microsoft one.

You basically need to implement an OIDC login (which you could do using
curl but unless you really know what you are doing using an existing
library is recommended) You also need to read the microsoft
documentation because a very large part of the setup is registering your
application as a client. As you said you were running on windows using
the microsoft authentication libraries to obtain an OAUTH token might be
the easiest route.

All of this is really off topic for curl however.

|epcc| Dr Stephen P Booth             Principal Architect       |epcc|
|epcc|          Phone 0131 650 5746       |epcc|
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
Received on 2023-09-28