Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
envio-correos-tls.ps1
$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
You can’t perform that action at this time.