-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy path108.ps1
More file actions
55 lines (50 loc) · 1.85 KB
/
Copy path108.ps1
File metadata and controls
55 lines (50 loc) · 1.85 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#——————————————————————————
# Func/Sub Name: Send-RTMTask
# Purpose: Sends a task to the Remember The Milk system via email.
# Arguments Supplied:
# Return Value:
# External Reference:
#——————————————————————————
function Send-RTMTask
{
param( [string]$TaskName=$(Throw "need TaskName"),
$Priority,
$DueDate,
$Repeat,
$TaskEstimate,
$Tags,
$Location,
$URL,
[string]$TaskList,
$Notes
)
Begin
{
@@ # Some Constants
@@ $RTMEmailAddress = ""
@@ $FromEmailAddress = ""
@@ $SMTPServer = ""
$MailClient = New-Object System.Net.Mail.SmtpClient($SMTPServer)
}
Process
{
$FromEmail = New-Object System.Net.Mail.MailAddress($FromEmailAddress )
$ToEmail = New-Object System.Net.Mail.MailAddress($RTMEmailAddress )
$MailMessage = New-Object System.Net.Mail.MailMessage( $FromEmail, $ToEmail)
$MailMessage.Subject = $TaskName
$Body = ""
if ( $Priority -ne $null ) { $Body += "P: $Priority`n" }
if ( $DueDate -ne $null ) { $Body += "Due: $DueDate`n" }
if ( $Repeat -ne $null ) { $Body += "Repeat: $Repeat`n" }
if ( $TaskEstimate -ne $null ) { $Body += "EstimateP: $TaskEstimate`n" }
if ( $Tags -ne $null ) { $Body += "Tags: $Tags`n" }
if ( $Location -ne $null ) { $Body += "Location: $Location`n" }
if ( $URL -ne $null ) { $Body += "URL: $URL`n" }
if ( $TaskList -ne $null ) { $Body += "List: $TaskList`n" }
if ( $Notes -ne $null ) { $Body += "--- `n $Notes" }
$MailMessage.Body = $Body
$MailClient.Send($MailMessage)
}
End
{ }
}