How to send email using PowerShell script

Опубликовано: 19 Май 2020
на канале: Dignesh Patel
1,187
12

Copy below script in notepad, change the required parameter and save it as SendMail.ps1

[System.Net.ServicePointManager]::SecurityProtocol = 'Tls,TLS11,TLS12'
$From = "Sender email address"
$To = "recipient’s email address"
$Cc = "cc recipient’s email address"
$Subject = "Your Subject"
$Body = "Message Body"
$SMTPServer = "SMTP Server address"
$SMTPPort = "SMTP Server port"
Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject -Body $Body -SmtpServer $SMTPServer -port $SMTPPort -UseSsl -Credential (Get-Credential)

Note :

Turn On Less secure app in Gmail - https://support.google.com/accounts/a...

Create App Password in Gmail -
https://support.google.com/accounts/a...

#powershell #emailscript


На этой странице сайта вы можете посмотреть видео онлайн How to send email using PowerShell script длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Dignesh Patel 19 Май 2020, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 1,187 раз и оно понравилось 12 зрителям. Приятного просмотра!