MsExchange Blog Spot Telnet25

June 11, 2009

PS Sent Mail Script

Filed under: General (1) — telnet25 @ 3:22 am

This time we will have PS to sent mail with Subject and Body we will define within the PS parameters. You can imagine what will be the upcoming articles about shortly , plugging this into PS script  and using PS to sent automated e-mails or alerts as you wish.

This little script is just going to sent mail out……..

image

# From relay@smtp25.org  This is from address Change it as you wish
# To oz@smtp25.org this is To address
# This is Subject line "Testing PS Script mail"
# This is Body of this E-mail "This script will E-mail you from Power Shell"
# smtpserver="HTS2" HTS2 is my Hub Transfer server, replace this to #your own
# Finally make sure Port 25 is not Blocked from where ever you running #this from and relay is working
$smtpserver="HTS2"
$smtp=New-Object Net.Mail.SmtpClient($smtpserver)
$smtp.send("relay@smtp25.org","oz@smtp25.org","Testing PS Script mail ","This script will E-mail you from Power Shell")

image

open your outlook you will see the e-mail. all credits goes to  powershellcommunity.org, and PowerGUI (-: for making live easy

image

Oz Casey Dedeal

MVP (Exchange)
MCITP (EMA), MCITP (SA)
MCSE 2003, M+, S+, MCDST
Security+, Project +, Server +

Http://smtp25.blogspot.com (Blog)

Https://telnet25.spaces.live.com (Blog)

Https://telnet25.worldpress.com (Blog)

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: