2023-01-01|閱讀時間 ‧ 約 2 分鐘

SMTP_setup

### Smtp setup

$smtp = "smtp.gmail.com"
$from = (hostname) + "@gmail.com"
$to = "Dean_zhong@gmail.com"
$CC = "Dean_zhong@gmail.com"
$date = Get-Date -Format yyyMMdd_HH:mm
$subject = "123456789  $SubjectService "
$encoding = [System.Text.Encoding]::UTF8
#$atcm1= "C:\JOBS\test20230101.txt"

#### Send Email

send-MailMessage -SmtpServer $smtp -From $from -To $to -Cc $cc -Subject $subject  -Encoding $encoding -Body  $StringMerge01 #-Attachments $atcm1
分享至
成為作者繼續創作的動力吧!
© 2024 vocus All rights reserved.