How to mail to bcc using powershell

To send an email to a blind carbon copy (BCC) recipient using PowerShell, you can use the Send-MailMessage cmdlet. Here's an example:

Send-MailMessage -From "your-email-address" -To "recipient-email-address" -Subject "Subject of the email" -Body "Body of the email" -Bcc "bcc-recipient-email-address"

Replace the placeholders with your actual email address, recipient email address, subject, body, and BCC recipient email address.

Here's a breakdown of the parameters:

You can also specify additional parameters, such as:

Here's an example with additional parameters:

$cred = Get-Credential -Username "your-email-address" -Password "your-password"
Send-MailMessage -From "your-email-address" -To "recipient-email-address" -Subject "Subject of the email" -Body "Body of the email" -Bcc "bcc-recipient-email-address" -SmtpServer "smtp.example.com" -UseSsl -Credential $cred

Make sure to replace the placeholders with your actual values and adjust the parameters as needed.

Note: The Send-MailMessage cmdlet is available in PowerShell 3 and later versions. If you're using an earlier version, you can use the Send-Mail cmdlet instead, but it doesn't support BCC recipients.