PowerShell/PowerShellでメールを送信するサンプルコード
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#navi(../)
* PowerShellでメールを送信するサンプルコード [#n55f7531]
PowerShellでメールを送信するサンプルコードを以下に記しま...
#contents
#htmlinsertpcsp(win-top.html,win-sp.html)
* メールの送信 [#z53e1efd]
単純なメール送信サンプルコードになります。
$smtp = "smtp" # SMTPサーバ
$port = 25 # SMTPポート
$from = "from@domain"
$to = "to@domain"
$body = "メール本文"
$SmtpClient = New-Object Net.Mail.SmtpClient($smtp,$port)
$Message = New-Object Net.Mail.MailMessage($from, $to...
$SmtpClient.Send($Message)
* HTMLメールの送信 [#i940288f]
単純なHTMLメール送信サンプルコードになります。
$smtp = "smtp" # SMTPサーバ
$port = 25 # SMTPポート
$from = "from@domain"
$to = "to@domain"
$body = "<b>メール本文</b>"
$SmtpClient = New-Object Net.Mail.SmtpClient($smtp,$port)
$Message = New-Object Net.Mail.MailMessage($from, $to...
$Message.IsBodyHtml = $True
$SmtpClient.Send($Message)
以上、PowerShellでメールを送信するサンプルコードでした。
#htmlinsertpcsp(win-btm.html,win-sp.html)
終了行:
#navi(../)
* PowerShellでメールを送信するサンプルコード [#n55f7531]
PowerShellでメールを送信するサンプルコードを以下に記しま...
#contents
#htmlinsertpcsp(win-top.html,win-sp.html)
* メールの送信 [#z53e1efd]
単純なメール送信サンプルコードになります。
$smtp = "smtp" # SMTPサーバ
$port = 25 # SMTPポート
$from = "from@domain"
$to = "to@domain"
$body = "メール本文"
$SmtpClient = New-Object Net.Mail.SmtpClient($smtp,$port)
$Message = New-Object Net.Mail.MailMessage($from, $to...
$SmtpClient.Send($Message)
* HTMLメールの送信 [#i940288f]
単純なHTMLメール送信サンプルコードになります。
$smtp = "smtp" # SMTPサーバ
$port = 25 # SMTPポート
$from = "from@domain"
$to = "to@domain"
$body = "<b>メール本文</b>"
$SmtpClient = New-Object Net.Mail.SmtpClient($smtp,$port)
$Message = New-Object Net.Mail.MailMessage($from, $to...
$Message.IsBodyHtml = $True
$SmtpClient.Send($Message)
以上、PowerShellでメールを送信するサンプルコードでした。
#htmlinsertpcsp(win-btm.html,win-sp.html)
ページ名: