CDOSYS help required - Urgent

CDOSYS help required - Urgent

Post by Gavin Joll » Sun, 22 Jun 2003 22:56:24



I am in urgent need of help. I have written an automated report request
application using VBScript and CDO 1.2.1 but now understand I need to make
it run using CDOSYS so I can schedule the script to run unattended.  I have
used scripts I have found on the net and my own ideas. (Thank you to the
author of the vbscript ini configuration utility I use heavily)

I have loaded the full script and components to an account
http://www.jolly.net.nz/files/. Anyone can use the script fior their own
needs if they want.
(*** Renamed the vbs extension to txt )
cdosys_send.txt *** Testing sending an email using CDOSYS
job_status.sql             Sample SQL scriopt I am running
report_control.ini        Control file for the script. Designed to allow
more reports to be easily added
report_v1.3.txt ***     CDO 1.2.1 script. Fully functioning but does alert
for Profile.

I need help to do the following with CDOSYS:
- Connect to an Exchange server on local network
- Read a users inbox, parsing each message
- Move messages to a subfolder of the inbox
- Send an email using the users account so it is saved in the Sent Items
folder

I can send email with attachments okay, but not through a specific users
account. See http://www.jolly.net.nz/files/cdosys_send.txt

Basically, the script monitors a specific user Inbox on MS Exchange and
responds to requests for reports. Each email can store multiple report
requests
It parses each request and saves a temporary ini file for each email.
Move the email to a sub folder (never got this step to work)
Parses the ini file
Validate each report request
Load the appropriate sql file
Execute the sql against the database using ado
Write the result to a file
Email Reply with all reports attached to the address specified in the
report_config.ini

Note:
- There are subdirectories mentioned in the report_control.ini for 1)Log
file  2) Report Requests 3) SQL files
- The last half of the file is a class for controlling INI files I sourced
from the NET somewhere
- Some documentation is in the top of the

All help much appreciated.

Gavin
gavin - at - jolly - dot - net - dot - nz

 
 
 

CDOSYS help required - Urgent

Post by Iain Pato » Mon, 23 Jun 2003 19:18:23



Quote:> I am in urgent need of help. I have written an automated report request
> application using VBScript and CDO 1.2.1 but now understand I need to make
> it run using CDOSYS so I can schedule the script to run unattended.  I

have

Why do you think you need CDOSYS for it to run unattended ?

Quote:> I need help to do the following with CDOSYS:
> - Connect to an Exchange server on local network

CDOSYS only talks SMTP, so you can't do this. If you have access to the
exchange server what you may be able to do is use it to write a transport
event sink which would allow you to intercept an incoming SMTP message. I
don't think this would work if the message arrived through normal exchange
methods tho..

Quote:> - Read a users inbox, parsing each message
> - Move messages to a subfolder of the inbox

CDOSYS has no facility to do either of these, you should use CDO 1.2.1 for
this

Quote:> - Send an email using the users account so it is saved in the Sent Items
> folder

Again, CDOSYS can't do this. What I do here is to BCC a copy of the message
to myself and have an exchange rule to move it to where I want it.

Quote:> I can send email with attachments okay, but not through a specific users
> account. See http://www.jolly.net.nz/files/cdosys_send.txt

With CDOSYS you are only injecting an SMTP message into the system, you will
never use use a users account/mailbox in the way I think you want to.
Dependant on how the security on the exchange serveer is setup, if you
arrange for the account that's running the script to have the 'Send As'
privelidge enabled for the account who's email address you want to use, you
will then be able to use CDOSYS to connect to the exchange server and send
an email with the appropriate email address.

What I would do is to use your working CDO 1.2.1 script with some minor
modifications:

1. When you schedule the task, make sure it runs under a specific known user
account setup for the purpose.
2. Have access to the mailbox you want to send from enabled for the user
account you're going to use.
3. On the system where the task is scheduled, log on with the account that
will be used and create a single profile that has access to the mailbox and
make it the default profile.

4. in s_exch change this line

      objUserSess.Logon "", "", False, True, 0, False, strProfileInfo

to something like this:

    objUserSess.Logon "profilename", , False, , , False

As long as the script runs under a user account that has access to the
mailbox used by the profile you specify then you should not be prompted for
anything on logon and it should happily run unattended.

I use this technique to manipulate a mailbox from within a Windows Service
with no user intervention. I will admit that I've not tried it using a
script and scheduled task, but as long as the useraccount it's running as
has access to the profile and associated mailbox then it should work without
problems.

Does this help ?

Iain.

 
 
 

1. CDOSYS help required - Urgent

I am in urgent need of help. I have written an automated report request
application using VBScript and CDO 1.2.1 but now understand I need to make
it run using CDOSYS so I can schedule the script to run unattended.  I have
used scripts I have found on the net and my own ideas. (Thank you to the
author of the vbscript ini configuration utility I use heavily)

I have loaded the full script and components to an account
http://www.jolly.net.nz/files/. Anyone can use the script fior their own
needs if they want.
(*** Renamed the vbs extension to txt )
cdosys_send.txt *** Testing sending an email using CDOSYS
job_status.sql             Sample SQL scriopt I am running
report_control.ini        Control file for the script. Designed to allow
more reports to be easily added
report_v1.3.txt ***     CDO 1.2.1 script. Fully functioning but does alert
for Profile.

I need help to do the following with CDOSYS:
- Connect to an Exchange server on local network
- Read a users inbox, parsing each message
- Move messages to a subfolder of the inbox
- Send an email using the users account so it is saved in the Sent Items
folder

I can send email with attachments okay, but not through a specific users
account. See http://www.jolly.net.nz/files/cdosys_send.txt

Basically, the script monitors a specific user Inbox on MS Exchange and
responds to requests for reports. Each email can store multiple report
requests
It parses each request and saves a temporary ini file for each email.
Move the email to a sub folder (never got this step to work)
Parses the ini file
Validate each report request
Load the appropriate sql file
Execute the sql against the database using ado
Write the result to a file
Email Reply with all reports attached to the address specified in the
report_config.ini

Note:
- There are subdirectories mentioned in the report_control.ini for 1)Log
file  2) Report Requests 3) SQL files
- The last half of the file is a class for controlling INI files I sourced
from the NET somewhere
- Some documentation is in the top of the

Sorry, Posted in old exchange group by mistake.

All help much appreciated.

Gavin
gavin - at - jolly - dot - net - dot - nz

2. E-mail delivery time

3. URGENT URGENT Help Required

4. PostOffice not updating address lists

5. Please help me - urgent help required

6. Help with In Box Assistant

7. Urgent help required - please help

8. messeage delivery filtering

9. evnet ID 4083 urgent, urgent, urgent......help, help....very urgent

10. SMTP routing: urgent help required!

11. Urgent help required please on database engine

12. Urgent Help Required

13. Urgent help required