Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Automatically send a mail on a certain time using outlook  2003

Posted on 2008-10-23
5
Medium Priority
?
1,293 Views
Last Modified: 2013-12-26
I need help on creating some sort of script to send mail out at 9 am every day to a email address.  Just on a weekday  

We use outlook 2003 with exchange 2003 and I can download visual basic  express I havent done any coding on VB so any help full answer will be appreciated
0
Comment
Question by:din101
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 22784508
Hi, din101.

Sending automatically is a problem since you're using Outlook 2003.  Microsoft added security features to Outlook preventing programs from sending messages automatically that weren't relaxed until Outlook 2007.  Those security features cannot be turned off, but they can be circumvented with 3rd-party tools.  Without sucha  tool it's impossible to send messages unattended.  Sending from code causes a dialog-box to pop up warning you that an application is trying to send and asking for your permission to allow it to continue.  You have to click a button for the message to send.  There are two tools for getting around this.  One is called Click-Yes (http://www.contextmagic.com/express-clickyes/).  It is a small utility that sits in the system tray and clicks the Yes button for you when the security dialog appears.  The other tool is Outlook Redemption (http://www.dimastr.com) a COM library that safely circumvents Outlook security in code.  You don't need a tool like VB to send messages.  You can do it with a simple bit of VBScript and schedule it to run using Windows Task Scheduler.  I can post the code if you want to do this.
0
 
LVL 3

Author Comment

by:din101
ID: 22784536
Yes please post the VB script.  Do I need to run both tools or just one of them ? I dont normally like to run many things on my computer but if I have to I dont mind.
0
 
LVL 76

Assisted Solution

by:David Lee
David Lee earned 2000 total points
ID: 22787917
Ok, here's the code.  Follow these instructions to use it.

1.  Open Notepad
2.  Copy the code and paste it into Notepad
3.  Edit the code.  Look for the comment lines to see what needs to change
4.  Save the file with a .vbs extension
5.  Create a scheduled task and set it to run the script at what interval you need

The computer must be logged in using an account that has access to Outlook.  This version of the code will work with Click-Yes.  You can test it without Click-Yes, you'll just get Outlook's security dialog-box.
Const olMailItem = 0
Dim olkApp, olkSes, olkMsg
On Error Resume Next
Set olkApp = GetObject(, "Outlook.Application")
On Error GoTo 0
If TypeName(olkApp) = "Nothing" Then
    Set olkApp = CreateObject("Outlook.Application")
    Set olkSes = olkApp.GetNamespace("MAPI")
    'Change the Outlook profile name on the next line as needed'
    olkSes.Logon "Outlook"
End If
Set olkMsg = olkApp.CreateItem(olMailItem)
With olkMsg
    'Change the address ont eh next line'
    .Recipients.Add "someone@company.com"
    .Recipients.ResolveAll
    'Change the subject on the next line'
    .Subject = "My Subject"
    'Change the message body on the next line'
    .Body = "Some text."
    .Send
End With
Set olkMsg = Nothing
Set olkSes = Nothing
Set olkApp = Nothing
WScript.Quit

Open in new window

0
 
LVL 3

Author Closing Comment

by:din101
ID: 31509134
Thank you very much
0
 
LVL 76

Expert Comment

by:David Lee
ID: 22788718
You're welcome.
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question