Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_cdo thread: automatically send email


Message #1 by "marina" <marina@m...> on Fri, 14 Sep 2001 12:18:11 +0800

hai, can you help me on how to send email automatically once in a day.

For example, got a few or none staff apply for the leave in a day. If 

got a staff who apply for the leave on that day, just one email only 

will send to the boss to inform him got staff apply leave, so he need to 

approve the form. Although a few staff appy just only one email will 

send too him at certain time for example 1 oclock. if no staff apply 

leave there is no email to boss.

hopefully you understand my question.



Message #2 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Fri, 14 Sep 2001 10:31:10 +0100
you need to write a script for Windows Script Host.  just write your script

in VBScript, same as you would for an ASP, but without the <%%> tags, and

without any HTML.  Also just use "createobject" rather than

"server.createobject".  Save your file with a .vbs extension.  



You can now run the script by typing 'cscript.exe "c:\path\script.vbs"' into

the command prompt (or by just double-clicking the file).  Once you are

happy that it works properly, you can schedule the above command line either

with the IE5 task scheduler or with the AT command (just type 'AT /?' into

the command prompt for help on this) 



-----Original Message-----

From: marina [mailto:marina@m...]

Sent: 14 September 2001 06:14

To: ASP CDO

Subject: [asp_cdo] automatically send email







hai, can you help me on how to send email automatically once in a day.

For example, got a few or none staff apply for the leave in a day. If 

got a staff who apply for the leave on that day, just one email only 

will send to the boss to inform him got staff apply leave, so he need to 

approve the form. Although a few staff appy just only one email will 

send too him at certain time for example 1 oclock. if no staff apply 

leave there is no email to boss.

hopefully you understand my question.







Message #3 by "marina" <marina@m...> on Fri, 14 Sep 2001 17:52:54 +0800
i am sorry for disturbing u again.

can u give me that script. ? Thanks alot.





----- Original Message -----

From: "Alex Shiell, ITS, EC, SE" <alex.shiell@s...>

To: "ASP CDO" <asp_cdo@p...>

Sent: Friday, September 14, 2001 5:31 PM

Subject: [asp_cdo] RE: automatically send email





> you need to write a script for Windows Script Host.  just write your

script

> in VBScript, same as you would for an ASP, but without the <%%> tags, and

> without any HTML.  Also just use "createobject" rather than

> "server.createobject".  Save your file with a .vbs extension.

>

> You can now run the script by typing 'cscript.exe "c:\path\script.vbs"'

into

> the command prompt (or by just double-clicking the file).  Once you are

> happy that it works properly, you can schedule the above command line

either

> with the IE5 task scheduler or with the AT command (just type 'AT /?' into

> the command prompt for help on this)

>

> -----Original Message-----

> From: marina [mailto:marina@m...]

> Sent: 14 September 2001 06:14

> To: ASP CDO

> Subject: [asp_cdo] automatically send email

>

>

>

> hai, can you help me on how to send email automatically once in a day.

> For example, got a few or none staff apply for the leave in a day. If 

> got a staff who apply for the leave on that day, just one email only 

> will send to the boss to inform him got staff apply leave, so he need to 

> approve the form. Although a few staff appy just only one email will 

> send too him at certain time for example 1 oclock. if no staff apply 

> leave there is no email to boss.

> hopefully you understand my question.
Message #4 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Fri, 14 Sep 2001 11:23:52 +0100
Well no I'm not going to write it for you!!  I don't know your requirements

apart from anything else...



OK right - basically what you need to do is write an ASP that does what you

want.  Then, when it works properly, go through the ASP and remove any HTML,

and any <%%> tags.  Also remove any refrences to the ASP objects, such as

response and request.  Replace 'server.createobject' with 'createobject'.

Now save it with a '.vbs' extension.



the code for sending a message is



    Set oMail = Server.CreateObject("CDONTS.Newmail")



    With oMail

        .To = sTo

        .From = sFrom

        .Subject = sSubject

        .Body = sBody

        .send

    End With

                

    Set oMail = Nothing



(sTo,sFrom,sSubject,sBody are all string variables that contain these parts

of the message)



-----Original Message-----

From: marina [mailto:marina@m...]

Sent: 14 September 2001 10:53

To: ASP CDO

Subject: [asp_cdo] RE: automatically send email





i am sorry for disturbing u again.

can u give me that script. ? Thanks alot.





----- Original Message -----

From: "Alex Shiell, ITS, EC, SE" <alex.shiell@s...>

To: "ASP CDO" <asp_cdo@p...>

Sent: Friday, September 14, 2001 5:31 PM

Subject: [asp_cdo] RE: automatically send email





> you need to write a script for Windows Script Host.  just write your

script

> in VBScript, same as you would for an ASP, but without the <%%> tags, and

> without any HTML.  Also just use "createobject" rather than

> "server.createobject".  Save your file with a .vbs extension.

>

> You can now run the script by typing 'cscript.exe "c:\path\script.vbs"'

into

> the command prompt (or by just double-clicking the file).  Once you are

> happy that it works properly, you can schedule the above command line

either

> with the IE5 task scheduler or with the AT command (just type 'AT /?' into

> the command prompt for help on this)

>

> -----Original Message-----

> From: marina [mailto:marina@m...]

> Sent: 14 September 2001 06:14

> To: ASP CDO

> Subject: [asp_cdo] automatically send email

>

>

>

> hai, can you help me on how to send email automatically once in a day.

> For example, got a few or none staff apply for the leave in a day. If 

> got a staff who apply for the leave on that day, just one email only 

> will send to the boss to inform him got staff apply leave, so he need to 

> approve the form. Although a few staff appy just only one email will 

> send too him at certain time for example 1 oclock. if no staff apply 

> leave there is no email to boss.

> hopefully you understand my question.

  Return to Index