{"id":299,"date":"2024-07-02T09:44:15","date_gmt":"2024-07-02T00:44:15","guid":{"rendered":"https:\/\/www.smartbizlife.com\/it\/?p=299"},"modified":"2024-07-02T09:44:15","modified_gmt":"2024-07-02T00:44:15","slug":"%e3%83%a1%e3%83%bc%e3%83%ab%e9%80%81%e4%bf%a1","status":"publish","type":"post","link":"https:\/\/www.smartbizlife.com\/it\/%e3%83%a1%e3%83%bc%e3%83%ab%e9%80%81%e4%bf%a1\/","title":{"rendered":"\u30e1\u30fc\u30eb\u9001\u4fe1"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted\"># \u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a<br>$SMTPServer = \"\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u30a2\u30c9\u30ec\u30b9\"<br>$Port = \"\u30dd\u30fc\u30c8\u756a\u53f7\"<br>$User = \"\u9001\u4fe1\u30e6\u30fc\u30b6\u30fc\u540d\"<br>$Password = \"\u9001\u4fe1\u30d1\u30b9\u30ef\u30fc\u30c9\"<br>$SMTPClient = New-Object Net.Mail.SmtpClient($SMTPServer,$Port)<br># SSL\u6697\u53f7\u5316\u901a\u4fe1\u3057\u306a\u3044 $false<br>$SMTPClient.EnableSsl=$false<br>$SMTPClient.Credentials=New-Object Net.NetworkCredential($User,$Password)${From}=\"\u9001\u4fe1\u5143\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\"<br>$Subject=\"\u4ef6\u540d\"<br>$mail_message=\"\u672c\u6587\"<br>#\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u306e\u8a2d\u5b9a<br>$FilePath=Split-Path \"\u30d5\u30a1\u30a4\u30eb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\" -parent<br>$File=@(Get-ChildItem $FilePath'\\\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u540d')<br>$To=\"\u5b9b\u5148\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\"<br># \u30e1\u30fc\u30eb\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u4f5c\u6210<br>$MailMassage=New-Object Net.Mail.MailMessage($From,$To,$Subject,$mail_message)<br># \u30d5\u30a1\u30a4\u30eb\u304b\u3089\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210<br>$Attachment=New-Object Net.Mail.Attachment($File)<br># \u30e1\u30fc\u30eb\u30e1\u30c3\u30bb\u30fc\u30b8\u306b\u6dfb\u4ed8<br>$MailMassage.Attachments.Add($Attachment)<br># \u30e1\u30fc\u30eb\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1<br>$SMTPClient.Send($MailMassage)<\/pre>\n","protected":false},"excerpt":{"rendered":"<p># \u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a$SMTPServer = &#8220;\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u30a2\u30c9\u30ec\u30b9&#8221;$Port = &#8220;\u30dd\u30fc\u30c8\u756a\u53f7&#8221;$User = &#8220;\u9001\u4fe1\u30e6\u30fc\u30b6\u30fc\u540d&#8221;$Password = &#8220;\u9001\u4fe1\u30d1\u30b9\u30ef\u30fc\u30c9&#8221;$SMTPCli<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,13,16],"tags":[],"class_list":["post-299","post","type-post","status-publish","format-standard","hentry","category-itknowhow","category-powershell","category-language"],"_links":{"self":[{"href":"https:\/\/www.smartbizlife.com\/it\/wp-json\/wp\/v2\/posts\/299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.smartbizlife.com\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.smartbizlife.com\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.smartbizlife.com\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.smartbizlife.com\/it\/wp-json\/wp\/v2\/comments?post=299"}],"version-history":[{"count":1,"href":"https:\/\/www.smartbizlife.com\/it\/wp-json\/wp\/v2\/posts\/299\/revisions"}],"predecessor-version":[{"id":300,"href":"https:\/\/www.smartbizlife.com\/it\/wp-json\/wp\/v2\/posts\/299\/revisions\/300"}],"wp:attachment":[{"href":"https:\/\/www.smartbizlife.com\/it\/wp-json\/wp\/v2\/media?parent=299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.smartbizlife.com\/it\/wp-json\/wp\/v2\/categories?post=299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.smartbizlife.com\/it\/wp-json\/wp\/v2\/tags?post=299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}