FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PowerShell/SendMail.ps1 at master · livemanager/PowerShell · GitHub
livemanager
/
PowerShell
Public
forked from
sperner/PowerShell
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
PowerShell
/
SendMail.ps1
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (32 loc) · 1.76 KB
Breadcrumbs
PowerShell
/
SendMail.ps1
Copy path
File metadata and controls
35 lines (32 loc) · 1.76 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#
How to send a mail in fsc.net
#
...without parameter "-credential ..." windows-logon-user/pass are used - no popup to enter password!
#
Send-MailMessage -to "MySelf <Sven.Sperner@ts.fujitsu.com>" -from "PowerShell <Sven.Sperner@ts.fujitsu.com>" `
#
-subject "PowerShell-Mail-Test" -credential "DOMFSC01\ffmsperners" -smtpserver "ABGZE78E.FSC.NET"
#
without password, with attachment
#
Send-MailMessage -to "MySelf <Sven.Sperner@ts.fujitsu.com>" -from "PowerShell <Sven.Sperner@ts.fujitsu.com>" `
#
-subject "PowerShell-Mail-AttachmentTest" -smtpserver "ABGZE78E.FSC.NET" -attachments "D:\text.txt"
#
mail-server in "citrix-net"
#
Send-MailMessage -to "MySelf <Sven.Sperner@ts.fujitsu.com>" `
#
-from "IAAS Reporting <IAAS.Reporting-DoNotRreply@ts.fujitsu.com>" `
#
-subject "IAAS-Report" `
#
-smtpserver "smtp.smc.fsc.net" `
#
-attachments ("C:\Dokumente und Einstellungen\Administrator\Desktop\Scripts\StatusList_2012-03-19*.csv"`
#
,"C:\Dokumente und Einstellungen\Administrator\Desktop\Scripts\StatusList_2012-03-19*.csv.summary.txt")
if
(
$args
[
0
] )
{
$attachments
=
@
(
get-childitem
"
$
(
$args
[
0
]
)
"
)
Send-MailMessage
-
to
"
MySelf <Sven.Sperner@ts.fujitsu.com>
"
`
-
from
"
SendMail-Script <SenMail-Script_DoNotRreply@ts.fujitsu.com>
"
`
-
subject
"
An attachment was sent
"
`
-
bodyashtml
"
Hello,<br/><br/>an attachment was appended.<br/><br/>Best regards
"
`
-
smtpserver
"
smtp.smc.fsc.net
"
`
-
attachments (
$attachments
)
}
else
{
Send-MailMessage
-
to
"
MySelf <Sven.Sperner@ts.fujitsu.com>
"
`
-
from
"
SendMail-Script <SenMail-Script_DoNotRreply@ts.fujitsu.com>
"
`
-
subject
"
Just a testmail
"
`
-
bodyashtml
"
Hello,<br/><br/>this is just a testmail.<br/>No files were attached.<br/><br/>Best regards
"
`
-
smtpserver
"
smtp.smc.fsc.net
"
}
Back
|
FazBrowse Home
|
New Git URL