×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Sending Email from Scheduled Tasks

Sending Email from Scheduled Tasks

Sending Email from Scheduled Tasks

(OP)
Hi All,

I am currently using a Windows 2003 server to send out reports and perform other tasks.
These are primarily VBscript programs which I am executing using wscript and are all setup as scheduled tasks. These have been working away fine for years.

However, as Windows Server 2003 is now end of life I am trying to move all these scheduled tasks to a Windows 2012 server. However, I am finding that the tasks will not send out emails when scheduled but they will send emails when I run them manually. I have setup a simple test script to just send an email:

set objCDO = CreateObject("CDO.Message")
objcdo.to = "me@mymail.com"
objCDO.From = "me@mymail.com"
objCDO.Subject = "Email Test"
objCDO.HTMLBody = "This is a test - " & Now()
objCDO.SEnd
set objCDO = nothing

I also setup a simple batch file to run this:

wscript.exe "S:\scripts\Once Off reports or scripts\EmailTest1.vbs"

I run the batch file manually and it works no problems - email is sent
When I create a schedule task to run the batch file and set it to run as the same user (the one I am logged in as), tasks scheduler says the task has run but no email is sent.
Can anyone please offer some advice on this.

Mighty

RE: Sending Email from Scheduled Tasks

(OP)
Thanks for the response
Unfortunately I have quite a number of script programs and some of them are very complex so changing to Powershell would be a big job
Everything works fine apart from the email issue.

Any other suggestions?

Mighty

RE: Sending Email from Scheduled Tasks

So what do the windows event logs say?

ACSS - SME
General Geek

RE: Sending Email from Scheduled Tasks

(OP)
Nothing in the event viewer

Mighty

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close