sending email with gmail using powershell

前端 未结 3 1498
庸人自扰
庸人自扰 2020-12-06 15:18

i am trying to send emails though gmail smtp server using powershell script. but i am not able to send emails .. i am using below script-

$EmailFrom = \"btt         


        
3条回答
  •  独厮守ぢ
    2020-12-06 15:58

    "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required."

    I recently ran into this issue with attempting to automate messages through my Gmail account. I do not like the option of allowing "access for less secure apps". I want forward thinking security. So I continued my search.

    My solution was to enable "2-Step" verification. This provides a slightly more secure solution as it provides an alternate password for your script to access your account.

    Sign in using App Passwords:
    https://support.google.com/accounts/answer/185833

    Stefan's link also has this solution, but it's buried in the comments and I didn't originally find it there until after I found it on my own through searching my Gmail account. That's why I am posting it here.

提交回复
热议问题