Skip to content

400 Client Error: Bad Request for url: https://graph.microsoft.com/v1.0/sendMail #1187

@iBuitron

Description

@iBuitron

Hi!
i follow the guide: and get requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://graph.microsoft.com/v1.0/sendMail | Error Message: Resource not found for the segment 'sendMail'.

from O365 import Account

credentials = (clientId, clientSecret)
account = Account(credentials, auth_flow_type="credentials", tenant_id=tenantId)


account = Account(credentials)
if account.authenticate(scopes=["basic", "message_all"]):
    print("Authenticated!")
    # IT WORKS


m = account.new_message()
m.to.add("ibu.624@gmail.com")
m.subject = "Testing!"
m.body = "George Best quote: I've stopped drinking, but only while I'm asleep."
m.send()

`requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://graph.microsoft.com/v1.0/sendMail | Error Message: Resource not found for the segment 'sendMail'.`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions