Good Vid Bernard, saved me a lot of trouble from trying to use MS Graph, a few pointers though, for unattended scripts, better to use the Microsoft Secret module, so for your credential you just pass " $creds = Get-Credential (Get-Secret -Vault MySecretVault -Name MySecretKey)",, Is there a reason you didn't just run the code from within VSCode but rather decided to copy and paste it in Powershell?
Thank you for your video. I got an error: "send-MailMessage: The SMTP server requires a secure connection or the client was not authenticated. The server response was; 5.7.57 client was not authenticated to send mail. Error 535 5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully." Do you know what can I do about it? (I'm using my employer account). Thanks a lot
I got this when trying to send from a gmail account. I think google has strict security restrictions recently. Switched to an outlook account and the script ran error free.
@@karanjadavid2178 You have to do fowlling things 1.go to gmail -->Setting-->Accounts and Imports tab -->Other google account setting --->Security Section 2.trun on 2 Step verification 3.create an APP Password 4.Copy that APP Password 5.Pate into the $pwd_1=" Your App Password " then just run the script you will able to send mails
Thanks mate, hours searching and failing and your video resolved it on the 1st go 🤗
Hi , which email did you use , outlook , gmail or any other?
Thank you for the video, its was very useful.. can you please let me know how to attach .pdf file
Good Vid Bernard, saved me a lot of trouble from trying to use MS Graph, a few pointers though, for unattended scripts, better to use the Microsoft Secret module, so for your credential you just pass " $creds = Get-Credential (Get-Secret -Vault MySecretVault -Name MySecretKey)",, Is there a reason you didn't just run the code from within VSCode but rather decided to copy and paste it in Powershell?
How to add sensitivity label ?
Thanks a lot I can send email using this, how we can add attachment and please let us know.
Really helped alot man. Ty
Thank you for this.
Very very thank you.!
Thank you for your video.
I got an error: "send-MailMessage: The SMTP server requires a secure connection or the client was not authenticated. The server response was; 5.7.57 client was not authenticated to send mail. Error 535 5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully." Do you know what can I do about it? (I'm using my employer account).
Thanks a lot
Same issue here, does anyone have a tip ? SMTP Auth already set on o365 for this account
I got this when trying to send from a gmail account. I think google has strict security restrictions recently. Switched to an outlook account and the script ran error free.
@@karanjadavid2178 You have to do fowlling things
1.go to gmail -->Setting-->Accounts and Imports tab -->Other google account setting --->Security Section
2.trun on 2 Step verification
3.create an APP Password
4.Copy that APP Password
5.Pate into the $pwd_1=" Your App Password " then just run the script you will able to send mails
If works Please message me back
Did anyone got the solution for this ?
Will this method still work with the deprecation of SMTP AUTH on 1st October??
I tried today 27th October 2022, can send email using above video tutorial
oauth v2.... not this old and insecure way
Send-MailMessage : A positional parameter cannot be found that accepts argument 'r'.
At line:1 char:1
+ Send-MailMessage @props @body
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Send-MailMessage], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SendMailMessage
Its $body