![]() ![]() If you do have a pointer to a good doc on using 365 Exchange to do this that would be great. You obviously cannot run everything from PowerShell 7 for example, Exchange on-premises cmdlets but it is great to use Microsoft 365 commands. I am the admin there so I'll start researching how to create an app password. PowerShell 7, which has been out for a little over a year now, seems to be snappier and faster than the older versions. I guess I need to find out how to do that as it has 2 step already on it. My conclusion is this is not the solution to my problem and I'll need to more likely use my 365 Small Business account to send the email. Now to use App Password I need to use 2-step verification which I don't want to do because I don't want to add this account to my phone for a number of reasons. To keep your account secure, Google will automatically turn this setting OFF if it’s not being used. To protect your account, apps and devices that use less secure sign-in technology are blocked. To do so, invoke the Run dialog box by pressing Windows + R and type pwsh and hit Enter, this command. Looks like you can't do that anymore: Less secure app access You can also access the PowerShell 7.0 via Run command. So I assume this is because I don't have "Less secure apps" in my Gmail account settings. ![]() | A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. While there is no immediate replacement available in PowerShell, we recommend you do not use Send-MailMessage at this time. This cmdlet does not guarantee secure connections to SMTP servers. OK, so what I get with that is: WARNING: The command 'Send-MailMessage' is obsolete. $EmailMessage.Body = New-Object ("plain") # Authenticate with the Gmail SMTP server using the App "") $Body = "This is a test email sent from PowerShell." Install-Module MailKit -Scope CurrentUser Maybe you can use the following # Install the MailKit module if it is not already installed ![]() Google offers app passwords because of 2-Step-Verification instead of Less secure app access now you can check the followingĪnd Send-MailMessage is obsolete but the other alternatives are not one line by default ![]()
0 Comments
Leave a Reply. |