Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

PSCX - Send-SmtpMail

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 11-12-2006   #1 (permalink)
Keith Hill [MVP]
Guest


 

PSCX - Send-SmtpMail

FYI, in the next drop of the PowerShell Community Extensions we will have a Send-SmtpMail cmdlet:

1# gcm Send-SmtpMail | fl

Name : Send-SmtpMail
CommandType : Cmdlet
Definition : Send-SmtpMail [-SmtpHost <String>] [-PortNumber <Int32
>] [-Credential <PSCredential>] [-From <String>] -To <

String[]> [-Cc <String[]>] [-Bcc <String[]>] [-Subject
<String>] [-Body <String>] [-AttachmentPaths <String[
]>] [-AttachmentLiteralPaths <String[]>] [-Timeout <In
t32>] [-HtmlBody] [-Verbose] [-Debug] [-ErrorAction <A
ctionPreference>] [-ErrorVariable <String>] [-OutVaria
ble <String>] [-OutBuffer <Int32>]
Send-SmtpMail [-SmtpHost <String>] [-PortNumber <Int32
>] [-Anonymous] [-From <String>] -To <String[]> [-Cc <

String[]>] [-Bcc <String[]>] [-Subject <String>] [-Bod
y <String>] [-AttachmentPaths <String[]>] [-Attachment
LiteralPaths <String[]>] [-Timeout <Int32>] [-HtmlBody
] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>
] [-ErrorVariable <String>] [-OutVariable <String>] [-
OutBuffer <Int32>]

Path :
AssemblyInfo :
DLL : C:\Program Files\PowerShell Community Extensions\PsCx.
Snapin.dll
HelpFile : PsCx.Snapin.dll-Help.xml
ParameterSets : {Authenticated, Anonymous}
ImplementingType : PsCx.Snapin.Commands.SendSmtpMailCommand
Verb : Send
Noun : SmtpMail

It can be used like so:

3# Send-SmtpMail -SmtpHost smtp.org -Credential (get-credential)
-From john_doe@foo.com -To jane_doe@bar.com
-Subject "Test Subject" -Body @"
>> Hi Jane,
>> Wassup?
>> --
>> John
>> "@
>>


or

4# Send-SmtpMail -To jane_doe@bar.com -Anonymous
-Subject "Vacation Photos" -Body "Check these out"
-AttachmentPaths *.jpg

Note that the last example relies on some PSCX preference variables being set (PscxSmtpHostPreference and PscxSmtpFromPreference).

--
Keith




My System SpecsSystem Spec
Old 11-12-2006   #2 (permalink)
klumsy@xtra.co.nz
Guest


 

Re: PSCX - Send-SmtpMail


looks promising keith.

My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom type error with PSCX under PS v2 CTP JamieB PowerShell 7 11-08-2007 09:03 PM
PSCX - Send-SmtpMail probs Neil Chambers PowerShell 4 06-22-2007 10:55 AM
PSCX 1.1 issues Marco Shaw PowerShell 8 03-16-2007 10:48 PM
[PSCX] What happened to Get-CmdLetMaml Joris van Lier PowerShell 2 03-11-2007 12:22 PM
PSCX 1.0 Released Keith Hill [MVP] PowerShell 4 12-13-2006 10:06 AM


Update your Vista Drivers Update Your Drivers Now!!

Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008