11-03-2009 06:48 AM
Solved! Go to Solution.
11-09-2009 04:54 AM
#* Send mail Write-host "`nSending mail" $from=new-object system.net.mail.mailaddress "monitoring@yourdomain.local"; $to = new-object system.net.mail.mailaddress "you@yourdomain.local"; #* Find the attachment to send $startpath = "C:\Program Files\Enterprise Vault\Reports\FSA\ppts on exch1\ArchiveScheduled\Completed" #* $startpath = "C:\Program Files\Enterprise Vault\Reports\FSA\ppts on exch1\ArchiveRunNow\Completed" $folder = get-childitem($startpath) | sort-object Name -Descending | select-object -first 1 $fullfolder = $startpath + "\" + $folder.name Write-host "`nLooking in folder name : " $fullfolder $filename = get-childitem($fullfolder) $att=$fullfolder + "\" + $filename.name Write-host "Attachment we will add is : " $att $mail=New-object system.net.mail.mailmessage $from, $to $mail.subject = "test message"; $mail.body = "some text"; $mail.attachments.add($att); $smtp = new-object system.net.mail.smtpclient("smtp-server.yourdomain.local"); "`nSending message to {0} by using SMTP host {1} port {2}." -f $to, $smtp.host, $smtp.port $smtp.send($mail);
11-04-2009 05:25 AM
11-04-2009 07:51 AM
11-04-2009 02:48 PM
11-06-2009 09:29 AM
11-07-2009 06:22 AM
11-09-2009 04:54 AM
#* Send mail Write-host "`nSending mail" $from=new-object system.net.mail.mailaddress "monitoring@yourdomain.local"; $to = new-object system.net.mail.mailaddress "you@yourdomain.local"; #* Find the attachment to send $startpath = "C:\Program Files\Enterprise Vault\Reports\FSA\ppts on exch1\ArchiveScheduled\Completed" #* $startpath = "C:\Program Files\Enterprise Vault\Reports\FSA\ppts on exch1\ArchiveRunNow\Completed" $folder = get-childitem($startpath) | sort-object Name -Descending | select-object -first 1 $fullfolder = $startpath + "\" + $folder.name Write-host "`nLooking in folder name : " $fullfolder $filename = get-childitem($fullfolder) $att=$fullfolder + "\" + $filename.name Write-host "Attachment we will add is : " $att $mail=New-object system.net.mail.mailmessage $from, $to $mail.subject = "test message"; $mail.body = "some text"; $mail.attachments.add($att); $smtp = new-object system.net.mail.smtpclient("smtp-server.yourdomain.local"); "`nSending message to {0} by using SMTP host {1} port {2}." -f $to, $smtp.host, $smtp.port $smtp.send($mail);
11-09-2009 08:00 AM