-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauto_mail.vbs
75 lines (48 loc) · 1.36 KB
/
auto_mail.vbs
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
' Version: 1.21
Const RECORD = "Record.txt"
Const MAIL_TO = "lixin@dvt.dvt.com"
Const MAIL_CC = "xiyan@dvt.dvt.com"
Dim iCount
iCount = 0
Set objFSO = Createobject ("Scripting.FileSystemObject")
If (objFSO.FileExists(RECORD)) Then
' Read last record, empty or modify time not today will both
' lead to count = 0
Set objFile = objFSO.GetFile(RECORD)
If DateDiff("d", objFile.DateLastModified, Now) < 1 Then
set textFile = objFSO.OpenTextFile(RECORD)
' FIXME:
iCount = textFile.ReadLine
textFile.close
End If
set objFile = Nothing
End If
Dim iResult
iResult = MsgBox("Happy time? ( Already " & iCount & " Today )", vbYesNo)
If iResult = vbYes Then
Randomize
WScript.Sleep 60 * 1000
Call Mail_Outlook("Íâ³öÎüÑÌ")
Dim delay
delay = Int(150 + Rnd * 120) * 1000
WScript.Sleep delay
Call Mail_Outlook("Íâ³öÎüÑÌ·µ»Ø")
iCount = iCount + 1
Set textFile = objFSO.CreateTextFile(RECORD,True)
textFile.Write iCount & vbCrLf
textFile.Close
End If
set objFSO = Nothing
Wscript.Quit
Sub Mail_Outlook(ByVal theSubject)
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.to = MAIL_TO
.CC = MAIL_CC
.Subject = theSubject
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub