https://mrpowerscripts.com/sending-an-email-from-powershell
Subscribe: http://bit.ly/mrps-yt-sub
Website: https://bit.ly/mrps-site
Discord: https://bit.ly/mrps-discord
Patreon: https://bit.ly/mrps-patreon
Power Up!: https://bit.ly/mrps-powerup
PEOPLE GETTING AUTHENTICATION ERRORS WITH GMAIL:
Google has changed a security setting that blocks "less secure" means of authentication by default. In order for this script to work you'll need to disable this option in your security settings.
Go to https://myaccount.google.com/security and scroll all the way to the bottom. There's a little toggle button for "Allow less secure apps". If you turn the toggle to ON it'll probably work.
Using Send-MailMessage
GET THE CODE:
https://github.com/MrPowerScripts/PowerScripts/blob/master/Cmdlets/SendMailMessage.ps1