Skip to main content
Older versions of Internet Explorer will not support certain site features. Chrome, Safari, Firefox, and Edge will provide the best experience.

Sending the E-mail notification by PowerShell Script


There is a way to send out the e-mail notification by PowerShell script if the client wants to get any email notification with attached for any file generated by Spok applications or any report which may be generated from the database (SF Case#00634195). Below script is used from a machine with SMTP/IIS enabled and there is the SMTP server is defined, which is accepts anonymous SMTP/relay for IP address of the sending host.

In the script, the sender,, sends the email with the subject, “Email Test with Attached”, body written as “Please check the attached”, and attachment, C:\test\Cardnumber.csv, to the recipients, and,  using the SMTP server as and the default port number for SMTP as 25.


$From = ""

$To = ""

$Cc = ""

$Attachment = " C:\test\Cardnumber.csv"

$Subject = " Email Test with Attached "

$Body = " Please check the attached "

$SMTPServer = " "

$SMTPPort = "25"

Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject -Body $Body -SmtpServer $SMTPServer -port $SMTPPort -Attachments $Attachment