Related:
- Copy files from one server to another
- How to open msi files on android - Guide
- Gmail incoming mail server - Guide
- Clear recent files windows 11 - Guide
- Free fire advance server - Guide
- How to open rem files without blackberry - Guide
1 response
Set objFSO1 = CreateObject("Scripting.FileSystemObject")
Set objwrc = objFSO1.CreateTextFile("c:\Jobs.txt", True)
dtmToday = Date()
FileName="myfile.txt"
objwrc.WriteLine "open ftp.myserver.com"
objwrc.WriteLine "myuser"
objwrc.WriteLine "mypassword"
objwrc.WriteLine "get "&FileName
objwrc.WriteLine "quit"
Set objShell = CreateObject("WScript.Shell")
Set objExecObject = objShell.Exec _
("%comspec% /c c:\windows\system32\ftp.exe -s:Jobs.txt")
Do While Not objExecObject.StdOut.AtEndOfStream
strText = objExecObject.StdOut.ReadAll()
If Instr(strText, "cannot find") > 0 Then
FTPStatus = " download failed"
Else
FTPStatus = " has been downloaded"
End If
Loop
Set objShell = Nothing
Dim objMail
Set objMail = CreateObject("CDO.Message")
Const cdoNTLM = 2 'NTLM
'This section provides the configuration information for the remote SMTP server.
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="127.0.0.1"
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objMail.Configuration.Fields.Update
objMail.From = "admin@myserver.com"
objMail.To = "me@me.com"
objMail.Subject = Filename & FTPStatus
objMail.Send
Set objMail = Nothing
Set objwrc = objFSO1.CreateTextFile("c:\Jobs.txt", True)
dtmToday = Date()
FileName="myfile.txt"
objwrc.WriteLine "open ftp.myserver.com"
objwrc.WriteLine "myuser"
objwrc.WriteLine "mypassword"
objwrc.WriteLine "get "&FileName
objwrc.WriteLine "quit"
Set objShell = CreateObject("WScript.Shell")
Set objExecObject = objShell.Exec _
("%comspec% /c c:\windows\system32\ftp.exe -s:Jobs.txt")
Do While Not objExecObject.StdOut.AtEndOfStream
strText = objExecObject.StdOut.ReadAll()
If Instr(strText, "cannot find") > 0 Then
FTPStatus = " download failed"
Else
FTPStatus = " has been downloaded"
End If
Loop
Set objShell = Nothing
Dim objMail
Set objMail = CreateObject("CDO.Message")
Const cdoNTLM = 2 'NTLM
'This section provides the configuration information for the remote SMTP server.
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="127.0.0.1"
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objMail.Configuration.Fields.Update
objMail.From = "admin@myserver.com"
objMail.To = "me@me.com"
objMail.Subject = Filename & FTPStatus
objMail.Send
Set objMail = Nothing