How do I know, when sending is ready???
I need to know, so I can disconnect the dial-up connection.

Thanks in advence
Andries


SCRIPT:

' Force explicit declaration of all variables.
Option Explicit

'***** DECLARATIONS*****************************
'Variables
Dim ReportFile, fName, objShell, oArgs
Dim strTo, strSubject, strBody
Dim objMail, iConf, Flds, i

'Constants
'Who the e-mail is from (this needs to have an e-mail address in it for the
e-mail to be sent)
Const strFrom = "from@emeel.org"
'Who the carbon copies are sent to
Const strCopy = "copy@emeel.org"
'Who the blind copies are sent to
Const strBCopy = ""
Const ReportPath = "C:\"

'Creates the main objects of the script
Set objShell = WScript.CreateObject("WScript.Shell")
Set objMail = Wscript.CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields

'*****[ MAIN SCRIPT ]*****************************

Set oArgs = WScript.Arguments
For i = 0 to oArgs.Count - 1
ReportFile = oArgs(i)
Next

fName = ReportPath & ReportFile

'Who the e-mail is sent to
strTo = "to@emeel.net"
'Set the subject of the e-mail
strSubject = "Automatic on: "
'Set the main body of the e-mail
strBody = "AUTO"
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing").Value = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver").Value =
"smtp.server"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport").Value= 25 .UpdateEnd WithSet objMail.Configuration = iConfobjMail.To = strToobjMail.CC = strCopyobjMail.BCC = strBCopyobjMail.From = strFromobjMail.Subject = strSubject & NowobjMail.TextBody = strBodyIf ReportFile <> "" Then objMail.AddAttachment(fName)End IfobjMail.Send'clean upSet Flds=nothingSet iConf=nothingSet objMail = NothingWScript.Quit

Re: How do I know, when sending is ready??? by Steven

Steven
Wed Dec 28 16:54:48 CST 2005

Add a prompt (see just above my signature)

' Force explicit declaration of all variables.
Option Explicit

'***** DECLARATIONS*****************************
'Variables
Dim ReportFile, fName, objShell, oArgs
Dim strTo, strSubject, strBody
Dim objMail, iConf, Flds, i

'Constants
'Who the e-mail is from (this needs to have an e-mail address in it for the
e-mail to be sent)
Const strFrom = "from@emeel.org"
'Who the carbon copies are sent to
Const strCopy = "copy@emeel.org"
'Who the blind copies are sent to
Const strBCopy = ""
Const ReportPath = "C:\"

'Creates the main objects of the script
Set objShell = WScript.CreateObject("WScript.Shell")
Set objMail = Wscript.CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields

'*****[ MAIN SCRIPT ]*****************************

Set oArgs = WScript.Arguments
For i = 0 to oArgs.Count - 1
ReportFile = oArgs(i)
Next

fName = ReportPath & ReportFile

'Who the e-mail is sent to
strTo = "to@emeel.net"
'Set the subject of the e-mail
strSubject = "Automatic on: "
'Set the main body of the e-mail
strBody = "AUTO"
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing").Value = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver").Value =
"smtp.server"

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport").Value
= 25
.Update
End With
Set objMail.Configuration = iConf
objMail.To = strTo
objMail.CC = strCopy
objMail.BCC = strBCopy
objMail.From = strFrom
objMail.Subject = strSubject & Now
objMail.TextBody = strBody
If ReportFile <> "" Then objMail.AddAttachment(fName)
objMail.Send
'clean up
Set Flds=nothing
Set iConf=nothing
Set objMail = Nothing

'// Display confirmation
WScript.Echo "E-mail sent ..."

WScript.Quit


--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Andries Oldenkamp" <a.oldenkampNOSP@Mhccnet.nl> wrote in message
news:OTUu517CGHA.2644@TK2MSFTNGP09.phx.gbl...
> How do I know, when sending is ready???
> I need to know, so I can disconnect the dial-up connection.
>
> Thanks in advence
> Andries
>
>
> SCRIPT:
>
> ' Force explicit declaration of all variables.
> Option Explicit
>
> '***** DECLARATIONS*****************************
> 'Variables
> Dim ReportFile, fName, objShell, oArgs
> Dim strTo, strSubject, strBody
> Dim objMail, iConf, Flds, i
>
> 'Constants
> 'Who the e-mail is from (this needs to have an e-mail address in it for
the
> e-mail to be sent)
> Const strFrom = "from@emeel.org"
> 'Who the carbon copies are sent to
> Const strCopy = "copy@emeel.org"
> 'Who the blind copies are sent to
> Const strBCopy = ""
> Const ReportPath = "C:\"
>
> 'Creates the main objects of the script
> Set objShell = WScript.CreateObject("WScript.Shell")
> Set objMail = Wscript.CreateObject("CDO.Message")
> Set iConf = CreateObject("CDO.Configuration")
> Set Flds = iConf.Fields
>
> '*****[ MAIN SCRIPT ]*****************************
>
> Set oArgs = WScript.Arguments
> For i = 0 to oArgs.Count - 1
> ReportFile = oArgs(i)
> Next
>
> fName = ReportPath & ReportFile
>
> 'Who the e-mail is sent to
> strTo = "to@emeel.net"
> 'Set the subject of the e-mail
> strSubject = "Automatic on: "
> 'Set the main body of the e-mail
> strBody = "AUTO"
> With Flds
> .Item("http://schemas.microsoft.com/cdo/configuration/sendusing").Value =
2
> .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver").Value
=
> "smtp.server"
>
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport").Value
= 25 .UpdateEnd WithSet objMail.Configuration = iConfobjMail.To =
strToobjMail.CC = strCopyobjMail.BCC = strBCopyobjMail.From =
strFromobjMail.Subject = strSubject & NowobjMail.TextBody = strBodyIf
ReportFile <> "" Then objMail.AddAttachment(fName)End IfobjMail.Send'clean
upSet Flds=nothingSet iConf=nothingSet objMail = NothingWScript.Quit
>