Windows & DOS: Issues & Discussions

All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here!

Powershell for Sending Attachment and Multiple Recipent

👤 Login to reply
Thread Tools Search this Thread Display Modes
Old 05-24-2018
alvinoo alvinoo is offline
Registered User
Join Date: Jun 2015
Last Activity: 24 May 2018, 4:49 AM EDT
Posts: 97
Thanks: 8
Thanked 1 Time in 1 Post
Powershell for Sending Attachment and Multiple Recipent

Hi there,

How could I invoke powershell to:
1. Send a file or an attachment
2. Send a content to multiple recipient
3. Be invoked by a batch file to execute the param clause

Help will be appreciate.

	[string]$highs, [string]$mediums, [string]$lows 

$EmailFrom = “”
$EmailTo = “”
$Subject = “New Scan is done!”
$Body = "High=$highs, Mediums=$mediums, Lows=$lows"
$SMTPServer = “”
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)
$SMTPClient.EnableSsl = $true
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential("Google-UserName", “Google-Password”);
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)

Sponsored Links
👤 Login to reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Need help sending attachment via mailx mrobin20 UNIX for Beginners Questions & Answers 5 01-27-2016 01:26 PM
Sending mail with attachment sv0081493 UNIX for Advanced & Expert Users 2 10-17-2012 01:39 PM
sending an email with attachment dudd9 Shell Programming and Scripting 4 11-30-2010 08:44 PM
Sending Email with Attachment balajiora Shell Programming and Scripting 3 05-29-2009 04:32 AM
sending an attachment through email Sgiri1 Shell Programming and Scripting 1 04-21-2009 12:46 AM

All times are GMT -4. The time now is 06:04 PM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.
Show Password

Not a Forum Member?
Forgot Password?