{"id":1119,"date":"2012-11-08T09:24:42","date_gmt":"2012-11-08T09:24:42","guid":{"rendered":"https:\/\/poiseddevelopers.com\/reality-tech\/?p=1119"},"modified":"2024-05-13T10:49:28","modified_gmt":"2024-05-13T10:49:28","slug":"send-email-from-powershell","status":"publish","type":"post","link":"https:\/\/poiseddevelopers.com\/reality-tech\/send-email-from-powershell\/","title":{"rendered":"Send Email From PowerShell"},"content":{"rendered":"<h2>Sending An Email from PowerShell<\/h2>\n<p>It\u2019s easy to send an email from PowerShell, and it\u2019s really useful for notifying yourself of the completion of a long-running script.<\/p>\n<p>It\u2019s also a way to document what ran when, if you are like me and running hundreds of scripts and need a way to organize documentation on when you run things.<\/p>\n<p>Just alter the parameters below, and let \u2018er rip and spam yourself!<\/p>\n<pre lang=\"php\">   param(  \r\n        [string] $From = \"server@joelDomain.com\",\r\n        [string] $To = \"joelplaut@joelDomain.com\",\r\n        [string] $Title = \"title\",\r\n        [string] $Body = \"body\"\r\n    )\r\n    $SmtpClient = New-Object System.Net.Mail.SmtpClient\r\n    $SmtpServer = \"mail.domainserver.com\"\r\n    $SmtpClient.host = $SmtpServer\r\n    $SmtpClient.Send($From,$To,$Title,$Body)<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Sending An Email from PowerShell It\u2019s easy to send an email from PowerShell, and it\u2019s really useful for notifying yourself of the completion of a long-running script. It\u2019s also a way to document what ran when, if you are like me and running hundreds of scripts and need a way to organize documentation on when [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":1124,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[26],"tags":[],"class_list":["post-1119","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"_links":{"self":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/comments?post=1119"}],"version-history":[{"count":2,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1119\/revisions"}],"predecessor-version":[{"id":3962,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1119\/revisions\/3962"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media\/1124"}],"wp:attachment":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media?parent=1119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/categories?post=1119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/tags?post=1119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}