Created
August 24, 2020 20:35
-
-
Save raulunzue/c04a43d9b76874238b877d6bdbec5aa8 to your computer and use it in GitHub Desktop.
envio-correos-tls.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$emailSmtpServer = "smtp.elblogdenegu.com" | |
$emailSmtpServerPort = "587" | |
$emailSmtpUser = "maquinasvirtuales@elblogdenegu.com" | |
$emailSmtpPass = "xxxxxx" | |
$emailFrom = "maquinasvirtuales@elblogdenegu.com" | |
$emailTo = "prueba01@maquinasvirtuales.eu" | |
$emailcc="prueba02@maquinasvirtuales.eu" | |
$emailMessage = New-Object System.Net.Mail.MailMessage($emailFrom , $emailTo ) | |
$emailMessage.cc.add($emailcc) | |
$emailMessage.Subject = "TEST" | |
#$emailMessage.IsBodyHtml = $true #true or false depends | |
$emailMessage.Body = "Envio de TEST desde Powershell" | |
$SMTPClient = New-Object System.Net.Mail.SmtpClient($emailSmtpServer , $emailSmtpServerPort ) | |
$SMTPClient.EnableSsl = $False | |
$SMTPClient.Credentials = New-ObjectSystem.Net.NetworkCredential( $emailSmtpUser , $emailSmtpPass); | |
$SMTPClient.Send( $emailMessage ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment