[Python] SMTP Authentication error while while sending mail from outlook using python language

Discussão em 'Python' iniciado por Stack, Fevereiro 8, 2025.

  1. Stack

    Stack Membro Participativo

    import smtplib


    smtpObj = smtplib.SMTP('smtp.office365.com', 587)

    smtpObj.ehlo()

    smtpObj.starttls()

    smtpObj.login('xxx@gmail.com', ' abcde')

    smtpObj.sendmail('xxx@gmail.com', 'yyyy@outlook.com', 'Subject: So long.\nDear Alice, so long and thanks for all the fish. Sincerely, Bob')

    {}

    smtpObj.close()


    The error I am getting

    SMTPAuthenticationError: (535, b'5.7.3 Authentication unsuccessful [BM1PR01CA0150.INDPRD01.PROD.OUTLOOK.COM]').

    Continue reading...

Compartilhe esta Página