?
Solved

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

Posted on 2013-01-27
2
Medium Priority
?
622 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 1000 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 1000 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

Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

Question has a verified solution.

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

Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

777 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