Solved

How would I add another email recipient to this powershell script?

Posted on 2013-01-27
2
619 Views
Last Modified: 2013-01-29
How would I add another email recipient to this powershell script?

$ol = New-Object -comObject Outlook.Application
$mail = $ol.CreateItem(0)
$Mail.Recipients.Add("me@email.com")
$Mail.Subject = "Report"
$Mail.Body = "
Hi there!
"
$Mail.Send()

Open in new window

0
Comment
Question by:Thaidog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 70

Accepted Solution

by:
Qlemo earned 250 total points
ID: 38824900
ol = New-Object -comObject Outlook.Application
$mail = $ol.CreateItem(0)
$Mail.Recipients.Add("me@email.com")
$Mail.Recipients.Add("mini-me@email.com")
$Mail.Subject = "Report"
$Mail.Body = "
Hi there!
"
$Mail.Send()

Open in new window

0
 
LVL 40

Assisted Solution

by:Subsun
Subsun earned 250 total points
ID: 38825666
I case, If you want to add multiple recipient in single line..
replace
$Mail.Recipients.Add("me@email.com")

with

$Mail.to = "me@email.com;me2@email.com;me2@email.com;me3@email.com"
0

Featured Post

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A brief introduction to what I consider to be the best editor for PowerShell.
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question