Solved

Automatically send a mail on a certain time using outlook  2003

Posted on 2008-10-23
5
1,274 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 500 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 500 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Outlook 2010 hyperlink issue 3 43
Make borderless form movable by user 2 27
can this macro be converted to sub procedure 4 34
Exchange Online Archive 2 27
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
Read this checklist to learn more about the 15 things you should never include in an email signature.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

751 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