Hello,

I am new to this forum and to scripting, and was hoping I could find
some help.

I want to email off a log file that is created each week. It puts the
report into the following path (and the html log file name is always
random):

c:\Nov2005\Week1\log0011029273.html

The month and week folders are created new each week, so I cant use a
static file location.

I have the following script that works fine for static files:
--------------------------------------------
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.Sender = "sc@co.com"
objMessage.To = "sc@co.com"
objMessage.TextBody = "This is some sample message text."
objMessage.AddAttachment "c:\Nov2005\Week1\log0011029273.html"

'==This section provides the configuration information for the remote
SMTP server.
'==Normally you will only change the server name or IP.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"mail.co.com"

'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25


objMessage.Configuration.Fields.Update

'==End remote SMTP server configuration section==

objMessage.Send

-----------------------------------------------------------


..but every time this report is run, it creates a new path to the new
report file...so this has to be the current
C:\month\week\randomlogfilename.html

Any help in constructing this would be much appreciated.



--
sc48226
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Re: sending an email of log file that is created in new folder each time by shiv_koirala

shiv_koirala
Wed Nov 02 00:44:55 CST 2005

The best is when the log files are created insert them in a database
and a flag saying had they been mailed. After that just loop through
the database values which have the path and send the mails.
-------
Regards ,
C#, VB.NET , SQL SERVER , UML , DESIGN Patterns Interview question book
http://www.geocities.com/dotnetinterviews/
My Interview Blog
http://spaces.msn.com/members/dotnetinterviews/