>I have a DTS package which contains a single step which is a visual foxpro 6 executable file. This exe processes data and then sends a mail message using ActiveX MAPI controls to various recipients.
>
>When I run the DTS package (using execute package) the mail gets sent. However if it is done as a scheduled task, then the jobs gets stuck at this point.
>
>I know from previous experience that if you run a scheduled task, it creates another login session on the machine to run the job, and any remote connections require password authentication (i.e. net use).
>
>Is there an equivalent for Microsoft Exchange to the net use command, or is there any additional setup required inside Exchange/SQL to make this work?
>
>(The mail has to be sent from within the Foxpro exe rather than a separate send mail task or notification message.)
>
Within the VFP app, you have a number of options - the Win32 API function WNetAddConnection3() can establish a drive mapping or log in to a server and permit access to a share, or you can rely on the services of an ActiveX component such as the Wscript.Network object from the WSH.
In VBA, you're probably best off relying on something like the Wscript.Network object.