Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Новый участник


Сообщения: 34
Благодарности: 1

Профиль | Отправить PM | Цитировать


deepred, да, спасибо разобрался, только немного скрипт подправили, а то он не зависимо от того менялся файл или нет отправлял сообщения.
Сделал вот так:
Option Explicit
Dim objFSO, objFile
Dim strPath2SourceFolder
Dim intPrefix, strMessage, strheadlist
Dim intErrLevel
Dim Message, iConf, Flds
strPath2SourceFolder = "D:\Temp\1C\"
intErrLevel = 0
strMessage = vbNullString
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
For Each objFile In objFSO.GetFolder(strPath2SourceFolder).Files
if UCase(objFSO.GetExtensionName(objFile.Name)) = UCase("txt") And DateDiff("n", objFile.DateLastModified, Now) > 1 Then
strMessage = strMessage & objFSO.GetFileName(objFile.Name) & vbCrLf
End If
next

if len(strMessage) > 1 then
strMessage = "Внимание, следующие файлы были изменены:"& vbCrLf & strMessage
Set Message = CreateObject("CDO.Message")
Message.To = "почтовый ящик куда придёт сообщение"
Message.From = "что будет указано в графе от"
Message.Subject = "RE: ! Warning!"
Message.TextBody = strMessage
Message.BodyPart.Charset = "windows-1251"
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp сервер"
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "пароль"
Flds.Update
Message.Configuration = iConf
Message.Send
end if
WScript.Quit 0

Всем спасибо!!!

Отправлено: 16:11, 06-07-2010 | #7