I'm sure you got it to work using shellexecute or something with the mailto
command, but it still doesn't change the fact that you cannot use the Outlook
Object Model inside an application that's run via the Task Scheduler. The
code you used did not use any Outlook objects (eg. Outlook.Application,
Outlook.MailItem, etc.), but you'd need to use the OOM if you wanted to
insert attachments.
Try Format(Date(), "ddmmyyyy").

Signature
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/
> I know that you know a hell of alot more than me, but i just sent
> myself an email via the script. It's a basic code to send out an email
[quoted text clipped - 37 lines]
> > > Thanks,
> > > Kevin
Dan Mitchell - 28 Jun 2006 22:36 GMT
=?Utf-8?B?RXJpYyBMZWdhdWx0IFtNVlAgLSBPdXRsb29rXQ==?=
<elegaultZZZ@REMOVEZZZmvps.org> wrote in
news:B83324B6-D6E0-474C-A993-3314F6E23C73@microsoft.com:
> it still doesn't change the fact that you cannot
> use the Outlook Object Model inside an application that's run via the
> Task Scheduler.
Strictly speaking, you _can_ run it, it just most likely won't work
properly. The KB article quotes four problems, which you can work around
by:
1. leaving the user that's meant to be running the Outlook code always
logged in
2. making sure the logged-in user isn't running Outlook when the
scheduled stuff is meant to fire off.
3. uh.. being lucky? heh. If it's working for the OP, then presumably
the particular mapi spooler interactions in question are going okay
4. writing code so it doesn't pop up any dialogs.
(wow, http://support.microsoft.com/kb/259971/ has an ingenious, but
also very ghastly hack to get around that last problem)
Point 3 is the obvious killer, and 1 and 2 basically clobber any sort
of normal run-as-a-service stuff, but in very particular, carefully
controlled, environments, it might be possible to get things to work.
It's sort of like coding with CDO1.21/ExMAPI and .Net, except the other
way around -- OOM from a service probably won't work, but occasionally
may mysteriously succeed; CDO1.21 will probably work okay from .Net, but
occasionally will mysteriously fail.
In general, though, it's much better to use CDO1.21/one of the other
CDOs/ExMAPI.
-- dan
Sue Mosher [MVP-Outlook] - 28 Jun 2006 22:40 GMT
I don't even think that hack for #4 will work on the most recent versions.
I'd use CDO for Windows to do this if it were my project.

Signature
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> =?Utf-8?B?RXJpYyBMZWdhdWx0IFtNVlAgLSBPdXRsb29rXQ==?=
> <elegaultZZZ@REMOVEZZZmvps.org> wrote in
[quoted text clipped - 31 lines]
>
> -- dan
Dan Mitchell - 29 Jun 2006 00:48 GMT
> I don't even think that hack for #4 will work on the most recent
> versions.
Yeah, I'll admit it was Outlook 97 when I last tried this sort of thing,
and stuff was generally a lot more lax back in those days.. :)
-- dan