Office Software Thread, Automated Email with attachments in Technical; I want to set up an automated email, that will send me an email every night at around 1am, with ...
10th September 2013, 12:44 PM #1
Automated Email with attachments
I want to set up an automated email, that will send me an email every night at around 1am, with a log file attachment which it pulls from a specified data source on said machine. Any ideas how I can set this up on outlook 2007?
I've looked into scripting but not too keen on it. Any and all help appreciated.
IDG Tech News
10th September 2013, 03:53 PM #2
Problem solved by scripting...
set a script for the outlook to start running the vbs, then set a script for the outlook to close after an hour.
Const SOURCE_FOLDER As String = "C:\temp\"
Const RECIP_A As String = "firstname.lastname@example.org"
Const RECIP_B As String = "email@example.com"
Const RECIP_C As String = "firstname.lastname@example.org"
Const SUBJECT As String = "ABC001 Logs"
Const EMAIL_BODY As String = "Please find attached file. Thanks and Regards, ABC"
On Error GoTo ErrorHandler
Dim fileName As String
fileName = Dir(SOURCE_FOLDER)
Do While Len(fileName) > 0
Call CreateEmail(SOURCE_FOLDER & fileName)
fileName = Dir
MsgBox Err.Number & " - " & Err.Description
Function CreateEmail(fileName As String)
Dim olApp As Outlook.Application
Dim msg As Outlook.MailItem
' create email
Set olApp = Outlook.Application
Set msg = olApp.CreateItem(olMailItem)
' set properties
.SUBJECT = SUBJECT
.Body = EMAIL_BODY
By Heggy in forum How do you do....it?
Last Post: 25th March 2011, 03:01 PM
By duncane in forum Windows
Last Post: 14th September 2009, 02:07 PM
By tosca925 in forum Windows
Last Post: 15th May 2007, 02:56 PM
By Ueline in forum Wireless Networks
Last Post: 7th December 2005, 12:00 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)