在 Powershell 中创建寻呼电子邮件

Creating a Paging Email in Powershell

提问人:IC3Certified 提问时间:10/31/2023 最后编辑:tripleeeIC3Certified 更新时间:10/31/2023 访问量:27

问:

我正在尝试为我的工作自动发送寻呼电子邮件。我是 Powershell 的新手,正在尝试更改我找到的电子邮件脚本。

模板:https://imgur.com/a/VHbkP1M

我要选择的电子邮件格式是:

Sender: [email protected]
Receiver: [email protected]
Subject: (1st,2nd,3rd) Shift Paging Log (Date)
Body:
Information Technology - Customer Support Center 
    2nd Shift Paging & Cell Call Log 
        10/30/2023 

========================================= 
SDM         Incident Details

Ticket#       Site is down
              @time(user input) Paged (Oncall For Site) with this being user input 
Ability to add multiple ticket pages
========================================= 
VIP Incident Report

SDM#:(user input)_
Customer:(user input)
Status: (user input)
Group: (user input)
Description: (user input) 
Ability to add multiple VIPS
========================================= 
Tech 1        Support Technician
Tech 2        Support Technician
Tech 3        Support Technician
========================================= 
[String]$Shift = Read-Host -Prompt 'Input the shift with the st or nd'
$Date = Get-Date
[String]$Page = Read-Host -Prompt 'Input the page with the time and ticket number.'


$sendSmtpAddress = "[email protected]"
$ol = new-object -comobject "outlook.application"
$account = $ol.session.accounts | ? { $_.smtpAddress -eq $sendSmtpAddress }
$mail = $ol.CreateItem(0)
$mail.recipients.add("[email protected]") 
$mail.subject = $Shift-"Shift Page Log "-$Date
$mail.body = $Page
$mail.SendUsingAccount = $account
$mail.Send()
PowerShell 电子邮件 自动化 用户输入

评论

0赞 tripleee 10/31/2023
另外,请使用 Stack Overflow 的图像托管,而不是一些远程广告支持的东西,我们必须在单独的窗口中单击打开(但不要发布无论如何都不会添加任何新信息的图像)
0赞 Civette 10/31/2023
问题在哪里?

答: 暂无答案