Permalink
Browse files

Update send-email

-fix bcc param
-fix SenderAddress param
-fix cc param
-fix replyto param
  • Loading branch information...
lazywinadmin committed Jul 14, 2015
1 parent ae92c67 commit 25044aa4f14a6eb24724acd971423499aa30ecda
Showing with 7 additions and 7 deletions.
  1. +7 −7 TOOL-Send-Email/TOOL-Send-Email.ps1
@@ -224,15 +224,15 @@
{
# Create Mail Message Object
$SMTPMessage = New-Object -TypeName System.Net.Mail.MailMessage
$SMTPMessage.From.Address = $From
$SMTPMessage.From = $From
FOREACH ($ToAddress in $To) { $SMTPMessage.To.add($ToAddress) }
$SMTPMessage.Body = $Body
$SMTPMessage.IsBodyHtml = $BodyIsHTML
$SMTPMessage.Subject = $Subject
$SMTPMessage.BodyEncoding = $([System.Text.Encoding]::$Encoding)
$SMTPMessage.SubjectEncoding = $([System.Text.Encoding]::$Encoding)
$SMTPMessage.Priority = $Priority
$SMTPMessage.Sender.Address = $SenderAddress
$SMTPMessage.Sender = $SenderAddress
# Sender Displayname parameter
IF ($PSBoundParameters['SenderDisplayName'])
@@ -247,15 +247,15 @@
}
# CC Parameter
IF ($PSBoundParameters['EmailCC'])
IF ($PSBoundParameters['CC'])
{
$SMTPMessage.CC.Add($EmailCC)
$SMTPMessage.CC.Add($CC)
}
# BCC Parameter
IF ($PSBoundParameters['EmailBCC'])
IF ($PSBoundParameters['BCC'])
{
$SMTPMessage.BCC.Add($EmailBCC)
$SMTPMessage.BCC.Add($BCC)
}
# ReplyToList Parameter
@@ -327,4 +327,4 @@
Remove-Variable -Name SMTPClient -ErrorAction SilentlyContinue
Remove-Variable -Name Password -ErrorAction SilentlyContinue
}#END
} #End Function Send-EMail
} #End Function Send-Email

0 comments on commit 25044aa

Please sign in to comment.